holoviz-topics / EarthSim

Tools for working with and visualizing environmental simulations.
https://earthsim.holoviz.org
BSD 3-Clause "New" or "Revised" License
65 stars 21 forks source link

Error on package update 'AttributeError: 'NoneType' object has no attribute '_plot_id'' #274

Closed kcpevey closed 5 years ago

kcpevey commented 5 years ago

@philippjfr I updated bokeh, gv, hv, panel and somehow this has broken the code we were working on this morning. Do you happen to know what's going on?

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
~/miniconda3/envs/earthsim/lib/python3.6/site-packages/IPython/core/formatters.py in __call__(self, obj, include, exclude)
    968 
    969             if method is not None:
--> 970                 return method(include=include, exclude=exclude)
    971             return None
    972         else:

~/ers/gitHub/panel/master/panel/panel/viewable.py in _repr_mimebundle_(self, include, exclude)
    107         doc = Document()
    108         comm = self._comm_manager.get_server_comm()
--> 109         model = self._get_root(doc, comm)
    110         Viewable._views[model.ref['id']] = (self, model)
    111         return render_mimebundle(model, doc, comm)

~/ers/gitHub/panel/master/panel/panel/viewable.py in _get_root(self, doc, comm)
     84           Optional pyviz_comms when working in notebook
     85         """
---> 86         root = self._get_model(doc, comm=comm)
     87         self._preprocess(root)
     88         return root

~/ers/gitHub/panel/master/panel/panel/layout.py in _get_model(self, doc, root, parent, comm)
    130         model = self._bokeh_model()
    131         root = model if root is None else root
--> 132         objects = self._get_objects(model, [], doc, root, comm)
    133 
    134         # HACK ALERT: Insert Spacer if last item in Column has no height

~/ers/gitHub/panel/master/panel/panel/layout.py in _get_objects(self, model, old_objects, doc, root, comm)
    123                 child = pane._models[root.ref['id']]
    124             else:
--> 125                 child = pane._get_model(doc, root, model, comm)
    126             new_models.append(child)
    127         return new_models

~/ers/gitHub/panel/master/panel/panel/param.py in _get_model(self, doc, root, parent, comm)
    466         if ref in self._callbacks:
    467             self._cleanup(root)
--> 468         model = self._inner_layout._get_model(doc, root, parent, comm)
    469         self._link_object_params(doc, root, parent, comm)
    470         self._models[ref] = model

~/ers/gitHub/panel/master/panel/panel/layout.py in _get_model(self, doc, root, parent, comm)
    130         model = self._bokeh_model()
    131         root = model if root is None else root
--> 132         objects = self._get_objects(model, [], doc, root, comm)
    133 
    134         # HACK ALERT: Insert Spacer if last item in Column has no height

~/ers/gitHub/panel/master/panel/panel/layout.py in _get_objects(self, model, old_objects, doc, root, comm)
    123                 child = pane._models[root.ref['id']]
    124             else:
--> 125                 child = pane._get_model(doc, root, model, comm)
    126             new_models.append(child)
    127         return new_models

~/ers/gitHub/panel/master/panel/panel/layout.py in _get_model(self, doc, root, parent, comm)
    130         model = self._bokeh_model()
    131         root = model if root is None else root
--> 132         objects = self._get_objects(model, [], doc, root, comm)
    133 
    134         # HACK ALERT: Insert Spacer if last item in Column has no height

~/ers/gitHub/panel/master/panel/panel/layout.py in _get_objects(self, model, old_objects, doc, root, comm)
    123                 child = pane._models[root.ref['id']]
    124             else:
--> 125                 child = pane._get_model(doc, root, model, comm)
    126             new_models.append(child)
    127         return new_models

~/ers/gitHub/panel/master/panel/panel/layout.py in _get_model(self, doc, root, parent, comm)
    130         model = self._bokeh_model()
    131         root = model if root is None else root
--> 132         objects = self._get_objects(model, [], doc, root, comm)
    133 
    134         # HACK ALERT: Insert Spacer if last item in Column has no height

~/ers/gitHub/panel/master/panel/panel/layout.py in _get_objects(self, model, old_objects, doc, root, comm)
    123                 child = pane._models[root.ref['id']]
    124             else:
--> 125                 child = pane._get_model(doc, root, model, comm)
    126             new_models.append(child)
    127         return new_models

~/ers/gitHub/panel/master/panel/panel/holoviews.py in _get_model(self, doc, root, parent, comm)
    112         """
    113         ref = root.ref['id']
--> 114         plot = self._render(doc, comm, root)
    115         child_pane = Pane(plot.state, _temporary=True)
    116         model = child_pane._get_model(doc, root, parent, comm)

~/ers/gitHub/panel/master/panel/panel/holoviews.py in _render(self, doc, comm, root)
     98         if comm:
     99             kwargs['comm'] = comm
--> 100         plot = renderer.get_plot(self.object, **kwargs)
    101         ref = root.ref['id']
    102         if ref in self._plots:

~/ers/gitHub/holoviews/master/holoviews/holoviews/plotting/bokeh/renderer.py in get_plot(self_or_cls, obj, doc, renderer, **kwargs)
    161             curdoc().theme = self_or_cls.theme
    162         doc.theme = self_or_cls.theme
--> 163         plot = super(BokehRenderer, self_or_cls).get_plot(obj, renderer, **kwargs)
    164         plot.document = doc
    165         return plot

~/ers/gitHub/holoviews/master/holoviews/holoviews/plotting/renderer.py in get_plot(self_or_cls, obj, renderer, **kwargs)
    205             init_key = tuple(v if d is None else d for v, d in
    206                              zip(plot.keys[0], defaults))
--> 207             plot.update(init_key)
    208         else:
    209             plot = obj

~/ers/gitHub/holoviews/master/holoviews/holoviews/plotting/plot.py in update(self, key)
    592     def update(self, key):
    593         if len(self) == 1 and ((key == 0) or (key == self.keys[0])) and not self.drawn:
--> 594             return self.initialize_plot()
    595         item = self.__getitem__(key)
    596         self.traverse(lambda x: setattr(x, '_updated', True))

~/ers/gitHub/geoviews/master/geoviews/geoviews/plotting/bokeh/plot.py in initialize_plot(self, ranges, plot, plots, source)
     86     def initialize_plot(self, ranges=None, plot=None, plots=None, source=None):
     87         opts = {} if isinstance(self, HvOverlayPlot) else {'source': source}
---> 88         fig = super(GeoPlot, self).initialize_plot(ranges, plot, plots, **opts)
     89         if self.geographic and self.show_bounds and not self.overlaid:
     90             from . import GeoShapePlot

~/ers/gitHub/holoviews/master/holoviews/holoviews/plotting/bokeh/element.py in initialize_plot(self, ranges, plot, plots)
   1802 
   1803         if self.top_level:
-> 1804             self.init_links()
   1805 
   1806         self._execute_hooks(element)

~/ers/gitHub/holoviews/master/holoviews/holoviews/plotting/bokeh/plot.py in init_links(self)
    413 
    414     def init_links(self):
--> 415         links = LinkCallback.find_links(self)
    416         callbacks = []
    417         for link, src_plot, tgt_plot in links:

~/ers/gitHub/holoviews/master/holoviews/holoviews/plotting/bokeh/callbacks.py in find_links(cls, root_plot)
   1202                     found.append((link, plot, None))
   1203                     continue
-> 1204                 potentials = [cls.find_link(p, link) for p in plots]
   1205                 tgt_links = [p for p in potentials if p is not None]
   1206                 if tgt_links:

~/ers/gitHub/holoviews/master/holoviews/holoviews/plotting/bokeh/callbacks.py in <listcomp>(.0)
   1202                     found.append((link, plot, None))
   1203                     continue
-> 1204                 potentials = [cls.find_link(p, link) for p in plots]
   1205                 tgt_links = [p for p in potentials if p is not None]
   1206                 if tgt_links:

~/ers/gitHub/holoviews/master/holoviews/holoviews/plotting/bokeh/callbacks.py in find_link(cls, plot, link)
   1224             else:
   1225                 if ((link.target is source) or
-> 1226                     (link.target._plot_id is not None and
   1227                      link.target._plot_id == source._plot_id)):
   1228                     return (plot, [link])

AttributeError: 'NoneType' object has no attribute '_plot_id'

@WilliamBLeonard is having the same issue building the same env from scratch.

philippjfr commented 5 years ago

I'll try to have a fix merged asap.

philippjfr commented 5 years ago

Could you pull holoviews and try again?

WilliamBLeonard commented 5 years ago

I just tried to pull holoviews - no changes from previous version. Unfortunately, the error is still occurring.

philippjfr commented 5 years ago

Could you post the last bit of the traceback? That must have changed.

WilliamBLeonard commented 5 years ago

Here's the last bit of the traceback - the error and the previous "chunk" of code in the error message (I think it's the same here):

~/es-workflows/src/holoviews/holoviews/plotting/bokeh/callbacks.py in find_link(cls, plot, link) 1224 else: 1225 if ((link.target is source) or -> 1226 (link.target._plot_id is not None and 1227 link.target._plot_id == source._plot_id)): 1228 return (plot, [link])

AttributeError: 'NoneType' object has no attribute '_plot_id'

(If you need any more info, please just let me know. Thanks!)

philippjfr commented 5 years ago

Apologies it seems my commit didn't actually get pushed, it's definitely updated now. Could you try once more?

WilliamBLeonard commented 5 years ago

You've made the error disappear. Thanks so much!

kcpevey commented 5 years ago

Looks great! Thanks @philippjfr !

philippjfr commented 5 years ago

Glad to hear it!