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

Dynamic operations only pass valid params #922

Merged
merged 1 commit into from Oct 10, 2016
Merged

Conversation

philippjfr
Copy link
Member

When creating a Dynamic ElementOperation with streams sometimes you want to supply additional streams, which do not supply parameters to the operation. This ensures that Dynamic only passes along parameters that are accepted by the operation.

@jlstevens
Copy link
Contributor

jlstevens commented Oct 10, 2016

Looks fine and the change makes sense. I still don't quite get the motivation though:

When creating a Dynamic ElementOperation with streams sometimes you want to supply additional streams, which do not supply parameters to the operation.

What do you mean? Do you have an example? That said, I see how this change would make using streams more robust....

@philippjfr
Copy link
Member Author

By default an operation can supply streams classes which supply parameters for the operation, e.g. think RangeXY which supplies x_range and y_range for the datashader operation. The user can however supply additional streams, which don't supply operation parameters, so this let's you do this:

bounds = Bounds(bounds=None)
decimate(datapoints, streams=[bounds, RangeXY()])

Without getting a bunch of warnings about bounds being passed to the decimate operation.

@jlstevens
Copy link
Contributor

Ok. Makes sense and the tests are passing. Merging.

@jlstevens jlstevens merged commit 5293e94 into master Oct 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants