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
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import holoviews as hv\n",
"import panel as pn\n",
"import numpy as np\n",
"import param\n",
"import time\n",
"hv.notebook_extension('bokeh')\n",
"pn.extension()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"class TaskControler(param.Parameterized):\n",
" \"\"\" Base class for widgets of type loading\n",
" add method control to create start and stop buttons\n",
" \"\"\"\n",
" t=param.Number(default=0., precedence=-1)\n",
" interval = param.Number(default=0.1, precedence=-1, doc=\"\"\"\n",
" Minimal time interval in seconds between two updates of the progress bar.\"\"\")\n",
" start = param.Action(lambda inst : inst._start_task())\n",
" stop = param.Action(lambda inst : inst._stop_task())\n",
"\n",
" def __init__(self, **params):\n",
" super(TaskControler,self).__init__(**params)\n",
" self._stop = True\n",
" self._running = False\n",
" \n",
" def _run(self):\n",
" self._t_start = time.time()\n",
" while not self._stop:\n",
" time.sleep(self.interval)\n",
" self.t = time.time()\n",
" self._t_end = time.time()\n",
" self._running = False\n",
" self.param.trigger('stop')\n",
" \n",
" def _start_task(self):\n",
" import threading\n",
" if self._running:\n",
" raise RuntimeError('Thread already running...')\n",
" self._running = True\n",
" self._stop = False\n",
" self.param.trigger('start')\n",
" threading.Thread(target=self._run).start()\n",
" \n",
" def _stop_task(self):\n",
" self._stop = True\n",
" \n",
" \n",
" @param.depends('t')\n",
" def _update_text(self):\n",
" if not self._stop:\n",
" return pn.pane.Markdown('####Working' + ' .'*int(self.t%6), height=0, width=200)\n",
" else:\n",
" return pn.pane.Markdown('####Idle', height=0, width=200)\n",
" \n",
" def view(self):\n",
" return self._update_text\n",
" \n",
" def controls(self):\n",
" return pn.Row(pn.Param(self,parameters=['start'],show_name=False),\n",
" pn.Param(self,parameters=['stop'],show_name=False))\n",
" \n",
" def panel(self):\n",
" return pn.Column(self.controls(), self.view())\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"class ControlerWithBar(TaskControler):\n",
" \n",
" def __init__(self, **params):\n",
" super(ControlerWithBar,self).__init__(**params)\n",
" self._cb_id = None\n",
" self._count= hv.streams.Stream.define('count', count=0.)()\n",
" \n",
" @param.depends('start',watch=True)\n",
" def _start_pb(self):\n",
" from bokeh.io import curdoc\n",
" if curdoc().session_context:\n",
" self._cb_id = curdoc().add_periodic_callback(self._server_pb_update, self.interval*1000)\n",
" else:\n",
" import threading\n",
" threading.Thread(target=self._notebook_pb_update).start()\n",
" \n",
" @param.depends('stop',watch=True)\n",
" def _stop_pb(self):\n",
" from bokeh.io import curdoc\n",
" from functools import partial\n",
" if curdoc().session_context:\n",
" curdoc().remove_periodic_callback(self._cb_id)\n",
" curdoc().add_next_tick_callback(self._reset_pb)\n",
" else:\n",
" self._reset_pb()\n",
" \n",
" def _reset_pb(self):\n",
" self._count.event(count=0)\n",
" \n",
" def _server_pb_update(self, value=None):\n",
" self._count.event(count=self._count.count+1)\n",
" \n",
" def _notebook_pb_update(self):\n",
" while not self._stop:\n",
" time.sleep(self.interval)\n",
" self._count.event(count=self._count.count+1)\n",
"\n",
" def _make_pb(self, count):\n",
" return hv.Points(((0.1*count)%1.1,0.5)).opts(height=25,xaxis=None,yaxis=None,toolbar=None,xlim=(0.,1.),size=15)\n",
" \n",
" def view(self):\n",
" pb = hv.DynamicMap(self._make_pb, streams=[self._count])\n",
" return pn.Column(super(ControlerWithBar,self).view(), pb)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"controller = ControlerWithBar()\n",
"controller.panel().show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
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

xavArtley commented Dec 23, 2018

Stack trace in a bokeh server

Exception in thread Thread-16:
Traceback (most recent call last):
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\threading.py", line 916, in _bootstrap_inner
    self.run()
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "<ipython-input-1-f89fee1474e6>", line 27, in _update
    self.t = time.time()
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\param\__init__.py", line 659, in __set__
    super(Number,self).__set__(obj,val)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\param\__init__.py", line 490, in __set__
    super(Dynamic,self).__set__(obj,val)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\param\parameterized.py", line 676, in __set__
    obj.param._call_watcher(s, event)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\param\parameterized.py", line 1128, in _call_watcher
    watcher.fn(self_._update_event_type(watcher, event, self_.self_or_cls.param._TRIGGER))
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\panel\param.py", line 435, in update_pane
    new_object = self.object()
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\param\parameterized.py", line 234, in _depends
    return func(*args,**kw)
  File "<ipython-input-1-f89fee1474e6>", line 56, in _update_text
    self.count+=1
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\param\__init__.py", line 659, in __set__
    super(Number,self).__set__(obj,val)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\param\__init__.py", line 490, in __set__
    super(Dynamic,self).__set__(obj,val)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\param\parameterized.py", line 676, in __set__
    obj.param._call_watcher(s, event)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\param\parameterized.py", line 1128, in _call_watcher
    watcher.fn(self_._update_event_type(watcher, event, self_.self_or_cls.param._TRIGGER))
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\holoviews\streams.py", line 630, in _watcher
    self.trigger([self])
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\holoviews\streams.py", line 157, in trigger
    subscriber(**dict(union))
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\holoviews\plotting\plot.py", line 615, in refresh
    self._trigger_refresh(stream_key)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\holoviews\plotting\plot.py", line 624, in _trigger_refresh
    self.update(key)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\holoviews\plotting\plot.py", line 596, in update
    item = self.__getitem__(key)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\holoviews\plotting\plot.py", line 261, in __getitem__
    self.update_frame(frame)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\holoviews\plotting\bokeh\element.py", line 1135, in update_frame
    self._update_plot(key, plot, style_element)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\holoviews\plotting\bokeh\element.py", line 598, in _update_plot
    plot.xgrid.grid_line_color = None
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\models\plots.py", line 38, in __setattr__
    setattr(x, attr, value)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\core\has_props.py", line 281, in __setattr__
    super(HasProps, self).__setattr__(name, value)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\core\property\descriptors.py", line 546, in __set__
    self._internal_set(obj, value, setter=setter)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\core\property\descriptors.py", line 770, in _internal_set
    self._real_set(obj, old, value, hint=hint, setter=setter)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\core\property\descriptors.py", line 839, in _real_set
    self._trigger(obj, old, value, hint=hint, setter=setter)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\core\property\descriptors.py", line 916, in _trigger
    obj.trigger(self.name, old, value, hint, setter)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\model.py", line 596, in trigger
    super(Model, self).trigger(attr, old, new, hint=hint, setter=setter)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\util\callback_manager.py", line 120, in trigger
    self._document._notify_change(self, attr, old, new, hint, setter, invoke)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\document\document.py", line 1005, in _notify_change
    self._trigger_on_change(event)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\document\document.py", line 1100, in _trigger_on_change
    self._with_self_as_curdoc(invoke_callbacks)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\document\document.py", line 1113, in _with_self_as_curdoc
    return f()
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\document\document.py", line 1099, in invoke_callbacks
    cb(event)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\document\document.py", line 669, in <lambda>
    self._callbacks[receiver] = lambda event: event.dispatch(receiver)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\document\events.py", line 245, in dispatch
    super(ModelChangedEvent, self).dispatch(receiver)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\document\events.py", line 127, in dispatch
    receiver._document_patched(self)
  File "C:\Users\Xavier\Miniconda3\envs\pyviz-tutorial\lib\site-packages\bokeh\server\session.py", line 180, in _document_patched
    raise RuntimeError("_pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes")
RuntimeError: _pending_writes should be non-None when we have a document lock, and we should have the lock when the document changes

@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