Skip to content

Instantly share code, notes, and snippets.

@xavArtley
Last active December 24, 2018 14:10
Show Gist options
  • Save xavArtley/087acbfc58e4fbde49f394b3aeed049c to your computer and use it in GitHub Desktop.
Save xavArtley/087acbfc58e4fbde49f394b3aeed049c to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xavArtley
Copy link
Author

Error at initialization:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-7-d827d80a32eb> in <module>
----> 1 pn.Column(controller.controls(), controller.view()).app()

~\examples\tutorial\panel_bug_thread.py in view(self)
     66     def view(self):
     67         pb = hv.DynamicMap(self._make_pb)
---> 68         return pn.Row(pn.Spacer(width=150), pn.Column(self._update_text, pb))
     69 
     70     def layout(self):

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\panel\layout.py in __init__(self, *objects, **params)
     49     def __init__(self, *objects, **params):
     50         from .pane import panel
---> 51         objects = [panel(pane, _internal=True) for pane in objects]
     52         super(Panel, self).__init__(objects=objects, **params)
     53 

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\panel\layout.py in <listcomp>(.0)
     49     def __init__(self, *objects, **params):
     50         from .pane import panel
---> 51         objects = [panel(pane, _internal=True) for pane in objects]
     52         super(Panel, self).__init__(objects=objects, **params)
     53 

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\panel\pane.py in panel(obj, **kwargs)
     45         return obj
     46     internal = kwargs.pop('_internal', False)
---> 47     pane = PaneBase.get_pane_type(obj)(obj, **kwargs)
     48     if internal and len(pane.layout) == 1:
     49         return pane.layout[0]

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\panel\param.py in __init__(self, object, **params)
    392                          if p not in self.params()}
    393         super(ParamMethod, self).__init__(object, **params)
--> 394         self._pane = Pane(self.object(), name=self.name,
    395                           **dict(_temporary=True, **self._kwargs))
    396         self._inner_layout = Row(self._pane)

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\param\parameterized.py in _depends(*args, **kw)
    232     @wraps(func)
    233     def _depends(*args,**kw):
--> 234         return func(*args,**kw)
    235 
    236     # storing here risks it being tricky to find if other libraries

~\examples\tutorial\panel_bug_thread.py in _update_text(self)
     54     def _update_text(self):
     55         if not self._stop:
---> 56             self.count += 1
     57             return pn.pane.Markdown('####Working' + ' .' * int(self.t % 6), height=0, width=200)
     58         else:

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\param\__init__.py in __set__(self, obj, val)
    657 
    658         if not callable(val): self._check_value(val)
--> 659         super(Number,self).__set__(obj,val)
    660 
    661 

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\param\__init__.py in __set__(self, obj, val)
    488         If val is dynamic, initialize it as a generator.
    489         """
--> 490         super(Dynamic,self).__set__(obj,val)
    491 
    492         dynamic = callable(val)

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\param\parameterized.py in __set__(self, obj, val)
    674         obj = self._owner if obj is None else obj
    675         for s in watchers:
--> 676             obj.param._call_watcher(s, event)
    677 
    678 

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\param\parameterized.py in _call_watcher(self_, watcher, event)
   1126                 self_._watchers.append(watcher)
   1127         elif watcher.mode == 'args':
-> 1128             watcher.fn(self_._update_event_type(watcher, event, self_.self_or_cls.param._TRIGGER))
   1129         else:
   1130             event = self_._update_event_type(watcher, event, self_.self_or_cls.param._TRIGGER)

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\holoviews\streams.py in _watcher(self, *events)
    628     def _watcher(self, *events):
    629         self._memoize = not any(e.type == 'triggered' for e in events)
--> 630         self.trigger([self])
    631         self._memoize = True
    632 

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\holoviews\streams.py in trigger(cls, streams)
    155         with triggering_streams(streams):
    156             for subscriber in subscribers:
--> 157                 subscriber(**dict(union))
    158 
    159         for stream in streams:

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\holoviews\plotting\plot.py in refresh(self, **kwargs)
    613         stream_key = util.wrap_tuple_streams(key, self.dimensions, self.streams)
    614 
--> 615         self._trigger_refresh(stream_key)
    616         if self.comm is not None and self.top_level:
    617             self.push()

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\holoviews\plotting\plot.py in _trigger_refresh(self, key)
    622         # Update if not top-level, batched or an ElementPlot
    623         if not self.top_level or isinstance(self, GenericElementPlot):
--> 624             self.update(key)
    625 
    626 

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\holoviews\plotting\plot.py in update(self, key)
    594         if len(self) == 1 and ((key == 0) or (key == self.keys[0])) and not self.drawn:
    595             return self.initialize_plot()
--> 596         item = self.__getitem__(key)
    597         self.traverse(lambda x: setattr(x, '_updated', True))
    598         return item

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\holoviews\plotting\plot.py in __getitem__(self, frame)
    259         if not isinstance(frame, tuple):
    260             frame = self.keys[frame]
--> 261         self.update_frame(frame)
    262         return self.state
    263 

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\holoviews\plotting\bokeh\element.py in update_frame(self, key, ranges, plot, element)
   1133         if not self.overlaid:
   1134             self._update_ranges(style_element, ranges)
-> 1135             self._update_plot(key, plot, style_element)
   1136             self._set_active_tools(plot)
   1137 

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\holoviews\plotting\bokeh\element.py in _update_plot(self, key, plot, element)
    597         if not self.show_grid:
    598             plot.xgrid.grid_line_color = None
--> 599             plot.ygrid.grid_line_color = None
    600         else:
    601             replace = ['bounds', 'bands', 'visible']

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\models\plots.py in __setattr__(self, attr, value)
     36     def __setattr__(self, attr, value):
     37         for x in self:
---> 38             setattr(x, attr, value)
     39 
     40     def __dir__(self):

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\core\has_props.py in __setattr__(self, name, value)
    279 
    280         if name in props or (descriptor is not None and descriptor.fset is not None):
--> 281             super(HasProps, self).__setattr__(name, value)
    282         else:
    283             matches, text = difflib.get_close_matches(name.lower(), props), "similar"

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\core\property\descriptors.py in __set__(self, obj, value, setter)
    544             raise RuntimeError("%s.%s is a readonly property" % (obj.__class__.__name__, self.name))
    545 
--> 546         self._internal_set(obj, value, setter=setter)
    547 
    548     def __delete__(self, obj):

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\core\property\descriptors.py in _internal_set(self, obj, value, hint, setter)
    768 
    769         old = self.__get__(obj, obj.__class__)
--> 770         self._real_set(obj, old, value, hint=hint, setter=setter)
    771 
    772     def _real_set(self, obj, old, value, hint=None, setter=None):

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\core\property\descriptors.py in _real_set(self, obj, old, value, hint, setter)
    837 
    838         # for notification purposes, "old" should be the logical old
--> 839         self._trigger(obj, old, value, hint=hint, setter=setter)
    840 
    841     # called when a container is mutated "behind our back" and

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\core\property\descriptors.py in _trigger(self, obj, old, value, hint, setter)
    914         '''
    915         if hasattr(obj, 'trigger'):
--> 916             obj.trigger(self.name, old, value, hint, setter)
    917 
    918 

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\model.py in trigger(self, attr, old, new, hint, setter)
    594                     self._document._invalidate_all_models()
    595         # chain up to invoke callbacks
--> 596         super(Model, self).trigger(attr, old, new, hint=hint, setter=setter)
    597 
    598     def _attach_document(self, doc):

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\util\callback_manager.py in trigger(self, attr, old, new, hint, setter)
    118                     callback(attr, old, new)
    119         if hasattr(self, '_document') and self._document is not None:
--> 120             self._document._notify_change(self, attr, old, new, hint, setter, invoke)
    121         else:
    122             invoke()

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\document\document.py in _notify_change(self, model, attr, old, new, hint, setter, callback_invoker)
   1003 
   1004         event = ModelChangedEvent(self, model, attr, old, new, serializable_new, hint, setter, callback_invoker)
-> 1005         self._trigger_on_change(event)
   1006 
   1007     def _push_all_models_freeze(self):

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\document\document.py in _trigger_on_change(self, event)
   1098             for cb in self._callbacks.values():
   1099                 cb(event)
-> 1100         self._with_self_as_curdoc(invoke_callbacks)
   1101 
   1102     def _with_self_as_curdoc(self, f):

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\document\document.py in _with_self_as_curdoc(self, f)
   1111             else:
   1112                 set_curdoc(self)
-> 1113             return f()
   1114         finally:
   1115             set_curdoc(old_doc)

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\document\document.py in invoke_callbacks()
   1097         def invoke_callbacks():
   1098             for cb in self._callbacks.values():
-> 1099                 cb(event)
   1100         self._with_self_as_curdoc(invoke_callbacks)
   1101 

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\document\document.py in <lambda>(event)
    667     def on_change_dispatch_to(self, receiver):
    668         if not receiver in self._callbacks:
--> 669             self._callbacks[receiver] = lambda event: event.dispatch(receiver)
    670 
    671     def on_session_destroyed(self, *callbacks):

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\document\events.py in dispatch(self, receiver)
    243 
    244         '''
--> 245         super(ModelChangedEvent, self).dispatch(receiver)
    246         if hasattr(receiver, '_document_model_changed'):
    247             receiver._document_model_changed(self)

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\document\events.py in dispatch(self, receiver)
    125         super(DocumentPatchedEvent, self).dispatch(receiver)
    126         if hasattr(receiver, '_document_patched'):
--> 127             receiver._document_patched(self)
    128 
    129     def generate(self, references, buffers):

~\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\server\session.py in _document_patched(self, event)
    178 
    179         if self._pending_writes is None:
--> 180             raise RuntimeError("_pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes")
    181 
    182         # TODO (havocp): our "change sync" protocol is flawed because if both

RuntimeError: _pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment