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

Starting affinder without layers causes Napari to crash #79

Open
andreasmarnold opened this issue Oct 30, 2023 · 0 comments
Open

Starting affinder without layers causes Napari to crash #79

andreasmarnold opened this issue Oct 30, 2023 · 0 comments

Comments

@andreasmarnold
Copy link
Contributor

When opening the "Start affinder" widgets without any active layers in the viewer:

import napari


viewer = napari.Viewer()

qtwidget, widget = viewer.window.add_plugin_dock_widget(
        'affinder', 'Start affinder'
        )

napari.run()

I get this error:

Traceback (most recent call last):
  File "C:\Users\arnoldam\custom_code\affinder\examples\error-example.py", line 8, in <module>
    qtwidget, widget = viewer.window.add_plugin_dock_widget(
  File "C:\Users\arnoldam\miniconda\envs\napari-main\lib\site-packages\napari\_qt\qt_main_window.py", line 811, in add_plugin_dock_widget
    wdg = _instantiate_dock_widget(
  File "C:\Users\arnoldam\miniconda\envs\napari-main\lib\site-packages\napari\_qt\qt_main_window.py", line 1465, in _instantiate_dock_widget
    return wdg_cls(**kwargs)
  File "C:\Users\arnoldam\miniconda\envs\napari-main\lib\site-packages\magicgui\type_map\_magicgui.py", line 487, in __call__
    self._widget_init(widget)
  File "C:\Users\arnoldam\custom_code\affinder\src\affinder\affinder.py", line 120, in _on_affinder_main_init
    _update_unique_choices(widget.moving, widget.reference.current_choice)
  File "C:\Users\arnoldam\custom_code\affinder\src\affinder\affinder.py", line 104, in _update_unique_choices
    index = choice_names.index(choice_name)
ValueError: '' is not in list

Process finished with exit code 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant