Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added datashader dynspread operation #1125

Merged
merged 2 commits into from
Feb 14, 2017
Merged

Added datashader dynspread operation #1125

merged 2 commits into from
Feb 14, 2017

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Feb 11, 2017

As the title says this adds a dynspread operation which implements dynamic pixel spreading on RGB types. It works on all Image, RGB and GridImage types.

@philippjfr philippjfr added the type: feature A major new feature label Feb 11, 2017
pixels using a specified compositing operator. This can be useful
to make sparse plots more visible. Dynamic spreading determines
how many pixels to spread based on a density heuristic.
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe point to this section of the datashader manual, to pass the buck for having to explain it in any more detail? (Not that the datashader site necessarily does, just that if someone wants more explanation, that's the place it should be provided, not in holoviews.)

max_px = param.Integer(default=2, doc="""
Maximum number of pixels to spread on all sides.
""")

Copy link
Member

@jbednar jbednar Feb 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the HoloViews docstring style? It's up to you, but personally I much prefer to have it tighter:

max_px = param.Integer(default=2, doc="""
    Maximum number of pixels to spread on all sides.""")

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, but we generally indent the docstring by four spaces.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops; that's just from having a proportional font in Github's editing box. Fixed; I too always use 4.

@jbednar
Copy link
Member

jbednar commented Feb 11, 2017

Looks good, thanks!


threshold = param.Number(default=0.8, doc="""
A tuning parameter in the range [0, 1]. Indicates the minimum
value for the density heuristic.""")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The important thing to convey here is the directionality -- does a higher value mean more spreading, or less?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copied the datashader docstring so you presumably update it there as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right; the original isn't clear either. I don't have it running here in a handy way to test it, but if you do, please check which way it works, update the docstring, and then I'll merge and update the original docstring.

Copy link
Member

@jbednar jbednar Feb 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

threshold = param.Number(default=0.8, bounds=(0,1), doc="""
    When spreading, determines how far to spread.
    Spreading starts at 1 pixel, and stops when the fraction
    of adjacent non-empty pixels reaches this threshold.  
    Higher values give more spreading, up to the max_px 
    allowed.""")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the docstring in the datashader source to say the above, now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great will make the fix shortly.

pixels.""")

max_px = param.Integer(default=2, doc="""
Maximum number of pixels to spread on all sides.""")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this default value does not match datashader's default value of 3? I think that could be confusing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I copied from one of my examples.

@jbednar jbednar merged commit aaebffa into master Feb 14, 2017
@jbednar jbednar deleted the datashader_dynspread branch February 14, 2017 15:49
@philippjfr philippjfr added this to the v1.7.0 milestone Feb 28, 2017
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature A major new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants