diff --git a/docs/docs_requirements.txt b/docs/docs_requirements.txt index 6571d22ac2..cd4982ca08 100644 --- a/docs/docs_requirements.txt +++ b/docs/docs_requirements.txt @@ -5,12 +5,11 @@ jupyter nbconvert myst_parser matplotlib -# bokeh 3 seems to break docs notebooks -bokeh<3 +bokeh # do not check import of next line ipython plotnine -numpy<2 +numpy plotly nbsphinx jinja2 diff --git a/nrn_requirements.txt b/nrn_requirements.txt index f049602b4e..1de5573095 100644 --- a/nrn_requirements.txt +++ b/nrn_requirements.txt @@ -3,8 +3,6 @@ setuptools_scm setuptools<=70.3.0 scikit-build matplotlib -# bokeh 3 seems to break docs notebooks -bokeh<3 ipython cython packaging diff --git a/share/lib/python/neuron/__init__.py b/share/lib/python/neuron/__init__.py index f84021c4da..7ea748288c 100644 --- a/share/lib/python/neuron/__init__.py +++ b/share/lib/python/neuron/__init__.py @@ -1835,3 +1835,13 @@ def _mview_html_tree(hlist, inside_mechanisms_in_use=0): if _get_ipython() is not None: html_formatter = _get_ipython().display_formatter.formatters["text/html"] html_formatter.for_type(hoc.HocObject, _hocobj_html) + +# in case Bokeh is installed, register a serialization function for hoc.Vector +try: + from bokeh.core.serialization import Serializer + + Serializer.register( + h.Vector, lambda obj, serializer: [serializer.encode(item) for item in obj] + ) +except ImportError: + pass