question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamicmap in Bokeh server fails in lookup_function of options.py

See original GitHub issue

Your following example for dynamicmap fails with the following error and doesn’t show any thing in the browser. OS: Ubuntu 16.06 Browser Chrome Bokeh: 0.12.13 Holoviews: 1.9.2 master on 05/02/2018 Python 3.6

Thanks

python

from bokeh.io import curdoc
import holoviews as hv
renderer = hv.renderer('bokeh')

doc = curdoc()

frequencies = [0.5, 0.75, 1.0, 1.25]

def sine_curve(phase, freq):
    xvals = [0.1* i for i in range(100)]
    return hv.Curve((xvals, [np.sin(phase+freq*x) for x in xvals]))

dmap = hv.DynamicMap(sine_curve, kdims=['phase', 'frequency'])
dmap.redim.range(phase=(0.5,1)).redim.range(frequency=(0.5,1.25))  
layout = renderer.get_plot(dmap, doc).state
doc.add_root(layout)

2018-02-05 22:57:48,165 Starting Bokeh server version 0.12.13 (running on Tornado 4.5.3) 2018-02-05 22:57:48,167 Bokeh app running at: http://localhost:5006/plt0 2018-02-05 22:57:48,167 Starting Bokeh server with process id: 29987 2018-02-05 22:57:53,668 Error running application handler <bokeh.application.handlers.script.ScriptHandler object at 0x7f12d6b81400>: ‘NoneType’ object has no attribute ‘id’ File “options.py”, line 1143, in lookup_options: if obj.id in cls._custom_options[backend]: Traceback (most recent call last): File “bokeh/application/handlers/code_runner.py”, line 125, in run exec(self._code, module.dict) File “plt0.py”, line 16, in layout = renderer.get_plot(dmap, doc).state File “holoviews-1.9.2-py3.6.egg/holoviews/plotting/bokeh/renderer.py”, line 123, in get_plot plot = super(BokehRenderer, self_or_cls).get_plot(obj, renderer) File “holoviews-1.9.2-py3.6.egg/holoviews/plotting/renderer.py”, line 177, in get_plot plot_opts = self_or_cls.plot_options(obj, self_or_cls.size) File “holoviews-1.9.2-py3.6.egg/holoviews/plotting/bokeh/renderer.py”, line 282, in plot_options options = plot.lookup_options(obj, ‘plot’).options File “holoviews-1.9.2-py3.6.egg/holoviews/plotting/plot.py”, line 81, in lookup_options node = Store.lookup_options(cls.backend, obj, group) File “holoviews-1.9.2-py3.6.egg/holoviews/core/options.py”, line 1143, in lookup_options if obj.id in cls._custom_options[backend]: AttributeError: ‘NoneType’ object has no attribute ‘id’

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
philippjfrcommented, Feb 26, 2018

Yes, thanks for pointing that out! I’d do this instead:

dmap = dmap.redim.range(phase=(0.5,1), frequency=(0.5,1.25))

Nonetheless this should raise a better error so I’ll leave the issue open.

0reactions
philippjfrcommented, Feb 26, 2018

Do DynamicMaps ever make sense to render without being redimmed?

Yes, a) you can declare a DynamicMap without dimensions which is common when using streams, and b) you can explicitly declare the ranges/values on the Dimensions when you declare a DynamicMap. I think the issue here was that usually the DynamicMap is validated before get_plot is called, I think all that needs to happen is to move the DynamicMap validation into Renderer._validate.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamicmap in Bokeh server fails in lookup_function ... - GitHub
Your following example for dynamicmap fails with the following error and doesn't show any thing in the browser. OS: Ubuntu 16.06. Browser Chrome...
Read more >
Running a Bokeh server
The bokeh command line tool lets you specify output options after processing your data. You could, for example, run bokeh json myapp.py to...
Read more >
Error while running bokeh server in dev mode - Stack Overflow
Already solved at the github issue: https://github.com/bokeh/bokeh/issues/12471 by @caroarriaga, just call the bokeh server using: python -m ...
Read more >
DynamicMap — HoloViews v1.15.3
Title: DynamicMap Container; Dependencies: Bokeh; Backends: Bokeh ... Note: To work with live data, you need a live Python server, not a static...
Read more >
Update dynamic map options parameters (colorbar limits) for ...
I have been able to redraw a plot with an updated color bar using plot.apply.opts(clim=(0,max)), but that does not update the server version ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found