jonescompneurolab / hnn-core

Simulation and optimization of neural circuits for MEG/EEG source estimates
https://jonescompneurolab.github.io/hnn-core/
BSD 3-Clause "New" or "Revised" License
51 stars 50 forks source link

hnn_widget.ipynb fails at cell 2 with list index out of range #747

Closed kenneth59715 closed 3 months ago

kenneth59715 commented 3 months ago

Hi,

I'm trying to run hnn_widget.ipynb in a voila jupyter extension environment. I'm getting the following traceback:

Warning: no DISPLAY environment variable. --No graphics will be displayed.


IndexError Traceback (most recent call last) Cell In[2], line 6 2 from IPython.display import display 4 gui = HNNGUI() ----> 6 display(gui.compose())

File /usr/local/python3.10/install/venv/lib/python3.10/site-packages/hnn_core/gui/gui.py:442, in HNNGUI.compose(self, return_layout) 440 cell_connectivity = Accordion(children=connectivity_boxes) 441 for idx, connectivity_name in enumerate(connectivity_names): --> 442 cell_connectivity.set_title(idx, connectivity_name) 444 drive_selections = VBox([ 445 self.add_drive_button, self.widget_drive_type_selection, 446 self.widget_location_selection], 447 layout=Layout(flex="1")) 449 drives_options = VBox([ 450 HBox([ 451 VBox([self.load_drives_button, self.delete_drive_button], (...) 454 ]), self._drives_out 455 ])

File /usr/local/python3.10/install/venv/lib/python3.10/site-packages/ipywidgets/widgets/widget_selectioncontainer.py:69, in _SelectionContainer.set_title(self, index, title) 67 if title is None: 68 title = '' ---> 69 titles[index]=title 70 self.titles = tuple(titles)

IndexError: list assignment index out of range

My pip freeze is: anyio==3.7.1 argon2-cffi==23.1.0 argon2-cffi-bindings==21.2.0 arrow==1.3.0 asttokens==2.4.1 async-lru==2.0.4 attrs==23.2.0 Babel==2.14.0 beautifulsoup4==4.12.3 bleach==6.1.0 certifi==2024.2.2
cffi==1.16.0 charset-normalizer==3.3.2 comm==0.2.2 contourpy==1.2.1 cycler==0.12.1 debugpy==1.8.1 decorator==5.1.1 defusedxml==0.7.1
entrypoints==0.4 exceptiongroup==1.2.0 executing==2.0.1 fastjsonschema==2.19.1 find_libpython==0.4.0 fonttools==4.51.0
fqdn==1.5.1 h11==0.14.0 hnn-core==0.3 httpcore==1.0.5 httpx==0.27.0 idna==3.6 ipykernel==6.29.4
ipympl==0.9.3 ipython==8.23.0 ipython-genutils==0.2.0 ipywidgets==8.1.2
isoduration==20.11.0 jedi==0.19.1 Jinja2==3.1.3 json5==0.9.24 jsonpointer==2.4 jsonschema==4.21.1
jsonschema-specifications==2023.12.1 jupyter-events==0.10.0 jupyter-lsp==2.2.4
jupyter_client==7.4.9 jupyter_core==5.7.2 jupyter_server==2.13.0 jupyter_server_terminals==0.5.3 jupyterlab==4.1.6
jupyterlab_pygments==0.3.0 jupyterlab_server==2.26.0 jupyterlab_widgets==3.0.10 kiwisolver==1.4.5
lxml==5.2.1 lxml_html_clean==0.1.1 MarkupSafe==2.1.5
matplotlib==3.8.4
matplotlib-inline==0.1.6 maturin==1.5.1 mistune==0.8.4 mpi4py==3.1.5 nbclassic==1.0.0 nbclient==0.5.13 nbconvert==6.5.4 nbformat==5.10.4 nest-asyncio==1.6.0 NEURON==8.2.4 notebook_shim==0.2.4 numpy==1.26.4 overrides==7.7.0 packaging==24.0 pandocfilters==1.5.1 parso==0.8.4 pexpect==4.9.0 pillow==10.3.0 platformdirs==4.2.0 prometheus_client==0.20.0 prompt-toolkit==3.0.43 psutil==5.9.8 ptyprocess==0.7.0
pure-eval==0.2.2 pycparser==2.22 Pygments==2.17.2 pyparsing==3.1.2 python-dateutil==2.9.0.post0 python-json-logger==2.0.7 PyYAML==6.0.1 pyzmq==24.0.1 referencing==0.34.0 requests==2.31.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rpds-py==0.18.0 scipy==1.13.0 Send2Trash==1.8.3
six==1.16.0 sniffio==1.3.1 soupsieve==2.5 stack-data==0.6.3
terminado==0.18.1
tinycss2==1.2.1 tomli==2.0.1 tornado==6.3.3 traitlets==5.14.2
types-python-dateutil==2.9.0.20240316 typing_extensions==4.11.0 uri-template==1.3.0 urllib3==2.2.1 voila==0.5.6 wcwidth==0.2.13 webcolors==1.13 webencodings==0.5.1 websocket-client==1.7.0 websockets==12.0 widgetsnbextension==4.0.10

I start jupyter lab, browse to the server, then access 'voila' instead of 'lab' in the URL.

Kenneth

jasmainak commented 3 months ago

@gtdang any insight what might be going on?

gtdang commented 3 months ago

Yes, I think this is because you are using versions of voila and ipywidgets that are not supported by hnn-core v0.3. Please note the dependency requirements: https://pypi.org/project/hnn-core/

ipywidgets had some breaking changes with their API as of v8.0. You will need to downgrade those packages for now. The next release of hnn-core is expected in May with a revamped GUI. It will use the newer versions of ipywidgets and voila.

kenneth59715 commented 3 months ago

Thanks for the info! Just want to note that the github page for hnn_core has a requirement for ipywidgets>=8.0.0

https://github.com/jonescompneurolab/hnn-core

Kenneth

Sent with Proton Mail secure email.

On Wednesday, April 10th, 2024 at 7:07 AM, George Dang @.***> wrote:

Yes, I think this is because you are using versions of voila and ipywidgets that are not supported by hnn-core v0.3. Please note the dependency requirements: https://pypi.org/project/hnn-core/

ipywidgets had some breaking changes with their API as of v8.0. You will need to downgrade those packages for now. The next release of hnn-core is expected in May with a revamped GUI. It will use the newer versions of ipywidgets and voila.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

gtdang commented 3 months ago

Thanks for the info! Just want to note that the github page for hnn_core has a requirement for ipywidgets>=8.0.0 https://github.com/jonescompneurolab/hnn-core Kenneth Sent with Proton Mail secure email. On Wednesday, April 10th, 2024 at 7:07 AM, George Dang @.> wrote: Yes, I think this is because you are using versions of voila and ipywidgets that are not supported by hnn-core v0.3. Please note the dependency requirements: https://pypi.org/project/hnn-core/ ipywidgets had some breaking changes with their API as of v8.0. You will need to downgrade those packages for now. The next release of hnn-core is expected in May with a revamped GUI. It will use the newer versions of ipywidgets and voila. — Reply to this email directly, [view it on GitHub](#747 (comment)), or unsubscribe. You are receiving this because you authored the thread.Message ID: @.>

@kenneth59715 Oof thanks for pointing that out. We should be keeping our working releases in a separate branch to avoid this confusion for users. @jasmainak @ntolley @rythorpe

jasmainak commented 3 months ago

Working releases are always in main ... every scientific Python package follows this workflow, we're not going to change that.

What we need to do is clarify the documentation. I'd suggest removing the version number and adding a note that users should not attempt to install packages from the list but use the setup.py. If you're cloning main and installing from it, you'll use the requirements.txt from the development branch and get the right version.

jasmainak commented 3 months ago

closed by #748