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

Conversation

Projects
None yet
2 participants
@philippjfr
Member

philippjfr commented Oct 10, 2016

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

This comment has been minimized.

Member

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

This comment has been minimized.

Member

philippjfr commented Oct 10, 2016

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

This comment has been minimized.

Member

jlstevens commented Oct 10, 2016

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

@jlstevens jlstevens merged commit 5293e94 into master Oct 10, 2016

4 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.004%) to 72.842%
Details
s3-reference-data-cache Test data is cached.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment