Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions tutorials/minian/pipeline_no_deconv.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,36 @@
],
"id": "wcell-23"
},
{
"cell_type": "code",
"execution_count": null,
"id": "wcell-bokeh-title-fix",
"metadata": {},
"outputs": [],
"source": [
"# [workshop] Keep plot titles working when the dask dashboard is open.\n",
"# HoloViews gives Bokeh a plain-string title, and Bokeh only turns that into a\n",
"# Title model while property validation is on. That flag is process-global, and\n",
"# dask's dashboard callbacks switch it off from the scheduler's thread; two\n",
"# overlapping switches restore it to the wrong value and leave it off for the\n",
"# rest of the kernel, after which every titled plot raises\n",
"# \"'str' object has no attribute 'update'\". Convert the title here so rendering\n",
"# does not depend on the flag.\n",
"from bokeh.models import Title\n",
"from holoviews.plotting.bokeh.element import ElementPlot\n",
"\n",
"if not getattr(ElementPlot._update_title, \"_coerces_str_title\", False):\n",
" _hv_update_title = ElementPlot._update_title\n",
"\n",
" def _update_title(self, key, plot, element):\n",
" if isinstance(plot.title, str):\n",
" plot.title = Title(text=plot.title)\n",
" return _hv_update_title(self, key, plot, element)\n",
"\n",
" _update_title._coerces_str_title = True\n",
" ElementPlot._update_title = _update_title"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
Loading