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

Add support for passing in parameter instances as streams #3616

Merged
merged 2 commits into from
Apr 10, 2019

Conversation

philippjfr
Copy link
Member

Makes it possible to pass in a Parameter instance as a stream, which will internally be converted to a Params stream. Also adds some validation to ensure the same parameter is not subscribed to multiple times.

  • Adds tests

@philippjfr philippjfr added the type: enhancement Minor feature or improvement to an existing feature label Apr 10, 2019
@philippjfr philippjfr added this to the v1.12.1 milestone Apr 10, 2019
Copy link
Member

@jbednar jbednar left a comment

Choose a reason for hiding this comment

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

Looks great, and should help keep user code simpler.

holoviews/streams.py Outdated Show resolved Hide resolved
@jlstevens
Copy link
Contributor

Looks good. I suppose we don't have any ideas on how to remap parameter names?

One thought I had (probably not a good idea) would be to allow something like:

hv.DynamicMap(..., streams={'foo':bar.param.baz})

This isn't great as you can't really mix parameter instances and streams nicely. Alternatively:

hv.DynamicMap(..., streams=[position_stream, ('foo', bar.param.baz)])

But I'm not hot on introducing more tuple formats.

@philippjfr
Copy link
Member Author

Looks good. I suppose we don't have any ideas on how to remap parameter names?

Yeah, it's unfortunate, but I don't want to rush things and come up with something we will hate later so I think this a safe first cut.

@jlstevens
Copy link
Contributor

Looks good! Much happier with the new warning.

@jlstevens
Copy link
Contributor

Tests are green. Merging.

@jlstevens jlstevens merged commit 02308a8 into master Apr 10, 2019
@philippjfr philippjfr deleted the parameter_instance_streams branch April 29, 2019 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Minor feature or improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants