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

Deprecate what keyword of watch_values #1004

Open
maximlt opened this issue Jan 3, 2025 · 0 comments
Open

Deprecate what keyword of watch_values #1004

maximlt opened this issue Jan 3, 2025 · 0 comments
Milestone

Comments

@maximlt
Copy link
Member

maximlt commented Jan 3, 2025

Deprecate what keyword of .param.watch_values as anyway the only allowed value is what='value'.

    def watch_values(self_, fn, parameter_names, what='value', onlychanged=True, queued=False, precedence=0):
        """
        Easier-to-use version of `watch` specific to watching for changes in parameter values.

        Only allows `what` to be 'value', and invokes the callback `fn` using keyword
        arguments <param_name>=<new_value> rather than with a list of Event objects.
        """
        if precedence < 0:
            raise ValueError("User-defined watch callbacks must declare "
                             "a positive precedence. Negative precedences "
                             "are reserved for internal Watchers.")
        assert what == 'value'
        ...

I'm not sure I ever used watch_values, even though it looks quite handy.

@maximlt maximlt added this to the v2.3.0 milestone Feb 13, 2025
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

No branches or pull requests

1 participant