Skip to content

Conversation

@jeylau
Copy link
Contributor

@jeylau jeylau commented Jun 16, 2023

Tested by @n-poulsen, @Timokleia and myself w/ napari==0.4.18 and PySide6<6.3.2.

Closes #2245

@jeylau jeylau added enhancement New feature or request GUI issues relating to GUI labels Jun 16, 2023
@jeylau jeylau requested a review from MMathisLab June 16, 2023 19:19
@jeylau jeylau self-assigned this Jun 16, 2023
@jeylau jeylau requested a review from n-poulsen June 19, 2023 15:18
@n-poulsen n-poulsen self-requested a review July 14, 2023 09:34
@n-poulsen
Copy link
Contributor

n-poulsen commented Jul 14, 2023

One issue I have with this release (using PySide6 6.5.1.1 and napari 0.4.18) is selecting videos for a project. When I click on a folder containing videos both are selected at first, but when I try to use the toggles to select only one I get into inconsistent states, with pictograms I don't quite understand.

Initial state
initial_state

Inconsistent state 1:
incosistent_state
2-5e3fbbe56b35)

Inconsistent state 2:
inconsistent_state_2

Are you able to replicate these issues?

@jeylau
Copy link
Contributor Author

jeylau commented Jul 14, 2023

Yes, good catch! Updating pyside6 broke the DragDropListView, let me look at it, there should be an easy fix.

@n-poulsen
Copy link
Contributor

This is more of an issue for napari-deeplabcut or napari, but with PySide6-6.3.1 I don't have the placeholder with low alpha (as mentioned above), and with PySide6-6.5.1 napari fails to load with error:

Traceback (most recent call last):
  File "/miniconda/envs/dlc/bin/napari", line 8, in <module>
    sys.exit(main())
  File "/miniconda/envs/dlc/lib/python3.10/site-packages/napari/__main__.py", line 564, in main
    _run()
  File "/miniconda/envs/dlc/lib/python3.10/site-packages/napari/__main__.py", line 326, in _run
    viewer = Viewer()
  File "/miniconda/envs/dlc/lib/python3.10/site-packages/napari/viewer.py", line 67, in __init__
    self._window = Window(self, show=show)
  File "/miniconda/envs/dlc/lib/python3.10/site-packages/napari/_qt/qt_main_window.py", line 577, in __init__
    self._qt_viewer.dockLayerList, tabify=False, menu=self.window_menu
  File"/miniconda/envs/dlc/lib/python3.10/site-packages/napari/_qt/qt_viewer.py", line 356, in dockLayerList
    layerListLayout.addWidget(self.layers)
  File "/miniconda/envs/dlc/lib/python3.10/site-packages/napari/_qt/qt_viewer.py", line 334, in layers
    self._layers = QtLayerList(self.viewer.layers)
  File "/miniconda/envs/dlc/lib/python3.10/site-packages/napari/_qt/containers/qt_layer_list.py", line 46, in __init__
    super().__init__(root, parent)
  File "/miniconda/envs/dlc/lib/python3.10/site-packages/napari/_qt/containers/qt_list_view.py", line 43, in __init__
    self.setRoot(root)
  File "/miniconda/envs/dlc/lib/python3.10/site-packages/napari/_qt/containers/_base_item_view.py", line 87, in setRoot
    self.setModel(create_model(root, self))
  File "/miniconda/envs/dlc/lib/python3.10/site-packages/napari/_qt/containers/_factory.py", line 72, in create_model
    return QtLayerListModel(obj, parent=parent)
  File "/miniconda/envs/dlc/lib/python3.10/site-packages/napari/_qt/containers/_base_item_model.py", line 80, in __init__
    super().__init__(parent=parent)
TypeError: object.__init__() takes exactly one argument (the instance to initialize)

My napari --info output is:

napari: 0.4.18
Platform: macOS-13.3.1-arm64-arm-64bit
System: MacOS 13.3.1
Python: 3.10.12 (main, Jul  5 2023, 15:02:25) [Clang 14.0.6 ]
Qt: 6.5.1
PySide6: 
NumPy: 1.23.5
SciPy: 1.10.1
Dask: 2022.01.1
VisPy: 0.12.2
magicgui: 0.7.2
superqt: unknown
in-n-out: 0.1.8
app-model: 0.1.4
npe2: 0.7.0

OpenGL:
  - GL version:  2.1 Metal - 83.1
  - MAX_TEXTURE_SIZE: 16384

Screens:
  - screen 1: resolution 1470x956, scale 2.0
  - screen 2: resolution 2560x1440, scale 1.0

Settings path:
  - /......6f4de/settings.yaml
Plugins:
  - napari: 0.4.18 (77 contributions)
  - napari-console: 0.0.8 (0 contributions)
  - napari-deeplabcut: 0.1.3.dev28+gc5e30c0 (16 contributions)
  - napari-svg: 0.1.10 (2 contributions)

@n-poulsen
Copy link
Contributor

n-poulsen commented Jul 14, 2023

The issue is solved for me by installing PyQt6 using pip install PyQt6. The output of napari --info is then:

WARNING: pyqt6 already imported, cannot switch to pyside6
WARNING:vispy:pyqt6 already imported, cannot switch to pyside6
napari: 0.4.18
Platform: macOS-13.3.1-arm64-arm-64bit
System: MacOS 13.3.1
Python: 3.10.12 (main, Jul  5 2023, 15:02:25) [Clang 14.0.6 ]
Qt: 6.5.1
PyQt6: 
NumPy: 1.23.5
SciPy: 1.10.1
Dask: 2023.7.0
VisPy: 0.12.2
magicgui: 0.7.2
superqt: unknown
in-n-out: 0.1.8
app-model: 0.2.0
npe2: 0.7.0

OpenGL:
  - GL version:  2.1 Metal - 83.1
  - MAX_TEXTURE_SIZE: 16384

Screens:
  - screen 1: resolution 1470x956, scale 2.0
  - screen 2: resolution 2560x1440, scale 1.0

Settings path:
  - /Users/niels/Library/Application Support/napari/upa_84ffcbcf74a467a4b2c47af3c3eded2cf816f4de/settings.yaml
Plugins:
  - napari: 0.4.18 (77 contributions)
  - napari-console: 0.0.8 (0 contributions)
  - napari-deeplabcut: 0.1.3.dev29+gbd53843 (16 contributions)
  - napari-svg: 0.1.10 (2 contributions)

From the two warnings at the top, it seems that PyQt6 has priority instead of PySide6 and is used. I'm not sure if this will have any side effects when using the labeling GUI.

EDIT:
This works when starting napari from the command line, but I continue having the issue when launching the napari GUI from the DeepLabCut GUI (clicking on "Label Frames"). So this does not fix it.

EDIT 2:
Some more information is available in the corresponding napari issue. Using PySide6==6.4.2 works for me (I get the correct placeholder formatting, and can label images using Napari).

@n-poulsen
Copy link
Contributor

I've tested this PR with napari-0.4.18, PySide6-6.3.1 and the latest napari-deeplabcut (created a project, extracted & labeled frames, trained a model, evaluated, analyzed a video).

Everything worked as expected, so I think napari-0.4.18 + PySide6-6.3.1 is the setup to go with. Even though there's no styling applied to the placeholder text, I think that's really not a blocker.

@jeylau jeylau marked this pull request as ready for review July 19, 2023 13:35
Copy link
Member

@MMathisLab MMathisLab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't not personally test, but lgtm! thanks @jeylau

@jeylau jeylau merged commit 5b68f80 into main Jul 25, 2023
@MMathisLab MMathisLab deleted the gui_improv branch July 25, 2023 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request GUI issues relating to GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Why is DontUseNativeDialog specified in project creation

4 participants