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

Make it easy to suppress linked stream parameters #1437

Closed
jlstevens opened this issue May 15, 2017 · 7 comments
Closed

Make it easy to suppress linked stream parameters #1437

jlstevens opened this issue May 15, 2017 · 7 comments
Labels
Milestone

Comments

@jlstevens
Copy link
Contributor

jlstevens commented May 15, 2017

Currently, when a linked stream has lots of stream parameters, the user is forced to handle them somehow, even if it means dumping extra arguments into **kwargs in their callback.

Instead of forcing users to use **kwargs for stream values they aren't interested in, it might be nice to allow explicit suppression of these parameters. Here is one suggestion I think is reasonable:

Drag(x=0,y=0).rename(drag_count=None) # Ignore the drag_count parameter

The way this could work would be to set the parameter precedences on the stream so they get ignored before passing the values to the callback. Using rename for this purpose overloads this method slightly but I think the semantics are reasonable and it makes more sense than introducing another method.

Note that in theory this could be used to remove PointerX and PointerY (and just have PointerXY) but I think having those is still a nice convenience.

@jlstevens
Copy link
Contributor Author

This should be easy to implement. The only thing is setting to None should set the precedence to something negative, say -1 but restoring the parameter (e.g renaming again with a string) should restore the precedence. Any original precedence value would be lost so I guess it would just restore to param's default precedence.

@jbednar
Copy link
Member

jbednar commented May 15, 2017

You could do -abs(precedence), or -precedence-1, I guess, since that would be invertible...

@jlstevens
Copy link
Contributor Author

Good idea!

@philippjfr
Copy link
Member

Has this been documented? If so I'll close this.

@jlstevens
Copy link
Contributor Author

I can put a stub in one of the user guides but it isn't documented currently anywhere else.

@jlstevens
Copy link
Contributor Author

I've added a paragraph about this feature to the correspond user guide in #1537. Closing.

Copy link

This issue 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 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants