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
Batch update for parameter values #24
Comments
Isn't this meant to be a param issue, that's assigned to either @ceball or @jlstevens ? |
To be clear I'm happy to leave this open since I will have to make use of the new capabilities that will be added to param here, but the majority of changes will happen at the param level. |
Let's treat the assignment to you as a prompt for you to explain those issues. For me, it is a Panel issue, because that's how I'm encountering it; it only occurs when I pass the |
Currently you subscribe to a parameter change like this: parameterized.param.watch(callback, 'parameter_a') i.e. you supply a callback that gets executed when the 'parameter_a' changes. The signature for that callback must be: def callback(change):
... where parameterized.param.watch(callback, ['parameter_a', 'parameter_b'])
def callback(*changes):
... where |
Presumably there would also need to be a mechanism to set parameters in batch, for such a callback with multiple changes ever to be generated? Maybe the |
I agree this needs changes at the param level but the issue is most clearly exposed when using I am happy to work on this if I am assigned this task! |
Now implemented. |
The reactivity that comes from watching parameter values is really helpful, but it causes problems when changing a lot of parameter values at once. E.g. for this code:
If I press the "Reset" button, it changes the four parameters one... by... one..., calling the view() function each time. Here view() is just a sleep call, but in practice in my real code it's a lengthy computation to plot something complicated, which is where I noticed the issue. Oddly, in my real code I also was able to watch the widget values update one by one, but here the widgets are failing to be updated by the reset call even though the parameter values have changed:
Note: this code depends on #21 so that the view() return type is representable, but I saw the problems with other Pane types before that PR.
The text was updated successfully, but these errors were encountered: