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

GUI: Creating figures with no data throws multiple exceptions #742

Closed
kmilo9999 opened this issue Mar 29, 2024 · 1 comment · Fixed by #746
Closed

GUI: Creating figures with no data throws multiple exceptions #742

kmilo9999 opened this issue Mar 29, 2024 · 1 comment · Fixed by #746
Labels
bug Something isn't working hnn-gui HNN GUI

Comments

@kmilo9999
Copy link
Collaborator

          The first bug is located in the `link_attribute.unlink()` method, which calls the `traitlets `package, a dependency of `ipywidgets`. These are the steps to reproduce it:
  1. Make an empty figure with no sim or loaded data in the app.
  2. Load or simulate data.

This is the traceback:

'Traceback (most recent call last):
 File "/mnt/c/Projects/Github/hnn-core-ccv/hnn_core/gui/_viz_manager.py", line 126, in wrapper
 link_attribute.unlink()
 File "/mnt/c/Projects/Github/hnn-core-ccv/venv310/lib/python3.10/site-packages/traitlets/traitlets.py", line 344, in unlink
 self.source[0].unobserve(self._update_target, names=self.source[1])
 File "/mnt/c/Projects/Github/hnn-core-ccv/venv310/lib/python3.10/site-packages/traitlets/traitlets.py", line 1698, in unobserve
 self._remove_notifiers(handler, name, type)
 File "/mnt/c/Projects/Github/hnn-core-ccv/venv310/lib/python3.10/site-packages/traitlets/traitlets.py", line 1592, in _remove_notifiers
 self._trait_notifiers[name][type].remove(handler)\nValueError: list.remove(x): x not in list'

The second bug is when you go to the visualization tab with no loaded data, and click the button 'Make figure'. This is the traceback:


 'Traceback (most recent call last):  
  File "/mnt/c/Projects/Github/hnn-core-ccv/hnn_core/gui/_viz_manager.py", line 129, in wrapper    
  result = f(self, *args, **kwargs)
  File "/mnt/c/Projects/Github/hnn-core-ccv/hnn_core/gui/_viz_manager.py", line 811, in add_figure
  _add_figure(None,
  File "/mnt/c/Projects/Github/hnn-core-ccv/hnn_core/gui/_viz_manager.py", line 685, in _add_figure
  _add_axes_controls(widgets, data, fig=fig, axd=axd)
  File "/mnt/c/Projects/Github/hnn-core-ccv/hnn_core/gui/_viz_manager.py", line 627, in _add_axes_controls
  children = [
  File "/mnt/c/Projects/Github/hnn-core-ccv/hnn_core/gui/_viz_manager.py", line 628, in <listcomp>
  _get_ax_control(widgets, data, fig_idx=fig_idx, fig=fig, ax=ax)
  File "/mnt/c/Projects/Github/hnn-core-ccv/hnn_core/gui/_viz_manager.py", line 432, in _get_ax_control
  sim_name_default = simulation_names[-1]\nIndexError: tuple index out of range'

Originally posted by @kmilo9999 in #730 (comment)

@gtdang gtdang added hnn-gui HNN GUI bug Something isn't working labels Mar 29, 2024
@gtdang gtdang changed the title Creating figures with no data throws multiple exceptions GUI: Creating figures with no data throws multiple exceptions Mar 29, 2024
@gtdang gtdang linked a pull request Jul 26, 2024 that will close this issue
@gtdang
Copy link
Collaborator

gtdang commented Jul 26, 2024

This was fixed with #746

@gtdang gtdang closed this as completed Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hnn-gui HNN GUI
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants