Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make notebooks work with bokeh>=3 and remove bokeh<3 pin #3061

Merged
merged 4 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 2 additions & 3 deletions docs/docs_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions nrn_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions share/lib/python/neuron/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1835,3 +1835,13 @@
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(

Check warning on line 1843 in share/lib/python/neuron/__init__.py

View check run for this annotation

Codecov / codecov/patch

share/lib/python/neuron/__init__.py#L1843

Added line #L1843 was not covered by tests
h.Vector, lambda obj, serializer: [serializer.encode(item) for item in obj]
)
except ImportError:
pass
Loading