-
-
Notifications
You must be signed in to change notification settings - Fork 525
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
Bokeh update causing "_pending_writes should be non-None" #1447
Comments
I should add that this error is not specific to the |
Potential workaround: calling |
In Bokeh you would also not be allowed to update the model directly, you would usually have to wrap the change in a callback, e.g. by using |
There is definitely an easier way to get at the color_mapper.document.add_next_tick_callback(lambda: color_mapper.update(high=100)) |
What I could imagine offering is a pn.io.server.update(color_mapper, high=100) |
Interesting I didn't know models referenced their documents However it references only the last one created? |
Correct that's why you should (almost) never share a Bokeh model across sessions, they are not designed to support this use caase.
That depends if you really want to share one model across sessions (which seems very rare) you will indeed have to find some way to do this, but the far more common scenario is that each session should create its own model and respond independently. |
Weirdly I can't reproduce this using Panel 0.9.7, which I can't really explain. Can anyone still reproduce this? That said I'm going to add an API to schedule a next tick callback from Panel anyway. |
Possibly a regression of #344.
I have a Bokeh figure with an image, colorbar, and colormapper. I want to interactively update the bounds on the colorbar. When I use Bokeh to serve the figure statically, this works great with
color_mapper.update(low=low, high=high)
. However, if I embed this figure in a panel withpn.pane.Bokeh(p)
, this command produces a RuntimeError from Bokeh, identical to that in #344 (stack trace & MRE below):I expected that as Panel is based off of Bokeh, I should be able to interactively update Bokeh plots.
This error seems to be related to pushing the change to the client browser. Even with the RuntimeError, refreshing the browser will yield the desired changes. The RuntimeError will not occur if the change does nothing; for example, trying to set the same parameter values twice will only cause an error on the first attempt.
I discovered this originally on
panel 0.9.5
&bokeh 2.0.1
but have since reproduced onpanel 0.9.6
&bokeh 2.1.0
, running on Ubuntu 16.04 LTS.Please let me know if there is a workaround, as short of swallowing the exception and forcing the client to refresh, I don't know any approaches. Thanks!
Here's my MRE:
Producing this stack trace:
The text was updated successfully, but these errors were encountered: