Skip to content

Conversation

@C-Achard
Copy link
Collaborator

@C-Achard C-Achard commented Aug 15, 2022

API & UI overhauls

TODO :

  • Restrict layer inference to Image layer type
  • Improve utils ?
  • Replace os imports + fix filenames in saving
  • Fix utilities layout scaling
  • Fix model framework rogue label -> create an empty widget and test there
  • Fix context menu duplicates. DONE but still requires instances to be kept in background
  • Fix anisotropy resize image/label type when showing in napari
  • Polish cropping by ensuring its associated widgets remain as long as they are needed
  • Possibility : make all widgets singletons to ensure there are no memory leaks. WORKAROUND : simply delete and re-create docked widgets
  • Test everything -> ensure utils type handling, all core functionality. Improve test coverage ? Add doctest

Maybe :

  • Make some widget elements that are opened on user action (mainly cropping) singletons to avoid issues with opening/closing

Note : check that correct layer types apply to all utils especially.

@C-Achard C-Achard added enhancement New feature or request UI Related to the UI labels Aug 15, 2022
@C-Achard C-Achard self-assigned this Aug 15, 2022
@deprecated-napari-hub-preview-bot
Copy link

deprecated-napari-hub-preview-bot bot commented Aug 15, 2022

Preview page for your plugin is ready here:
https://preview.napari-hub.org/AdaptiveMotorControlLab/CellSeg3d/28
Updated: 2022-10-02T09:04:07.530381

@codecov-commenter
Copy link

codecov-commenter commented Aug 15, 2022

Codecov Report

Merging #28 (2ebdc5d) into main (30c3e4d) will increase coverage by 17.61%.
The diff coverage is 63.17%.

@@             Coverage Diff             @@
##             main      #28       +/-   ##
===========================================
+ Coverage   37.59%   55.21%   +17.61%     
===========================================
  Files          38       44        +6     
  Lines        3511     4211      +700     
===========================================
+ Hits         1320     2325     +1005     
+ Misses       2191     1886      -305     
Impacted Files Coverage Δ
...ri_cellseg3d/code_models/models/model_SwinUNetR.py 54.54% <ø> (ø)
...ari_cellseg3d/code_models/models/model_TRAILMAP.py 0.00% <ø> (ø)
napari_cellseg3d/code_models/models/model_VNet.py 42.85% <ø> (ø)
...ellseg3d/code_models/models/unet/buildingblocks.py 22.50% <ø> (ø)
napari_cellseg3d/code_plugins/plugin_metrics.py 0.00% <0.00%> (ø)
napari_cellseg3d/dev_scripts/drafts.py 0.00% <ø> (ø)
napari_cellseg3d/dev_scripts/weight_conversion.py 0.00% <0.00%> (ø)
napari_cellseg3d/plugins.py 0.00% <0.00%> (ø)
napari_cellseg3d/code_models/model_workers.py 24.55% <23.64%> (ø)
napari_cellseg3d/code_plugins/plugin_crop.py 34.61% <34.61%> (ø)
... and 28 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@C-Achard C-Achard mentioned this pull request Aug 19, 2022
@C-Achard C-Achard mentioned this pull request Sep 2, 2022
33 tasks
@C-Achard C-Achard mentioned this pull request Oct 31, 2022
@C-Achard C-Achard closed this Mar 1, 2023
@C-Achard C-Achard reopened this Mar 1, 2023
@C-Achard C-Achard marked this pull request as ready for review March 1, 2023 15:19
@C-Achard C-Achard requested a review from MMathisLab March 1, 2023 15:19
@MMathisLab
Copy link
Member

looking forward to reviewing! It's a big one (with some conflicts, so maybe rebase to main first?) Also good to have Tim test the user experience?

@C-Achard
Copy link
Collaborator Author

C-Achard commented Mar 1, 2023

looking forward to reviewing! It's a big one (with some conflicts, so maybe rebase to main first?) Also good to have Tim test the user experience?

@MMathisLab I will fix the conflicts when merging, I've already included most of the changes from main manually. I'll ask Tim as well, thank you!

@MMathisLab
Copy link
Member

but can you please rebase before I review it? see basecamp :D

C-Achard added 15 commits March 1, 2023 18:38
- GroupedWidgets replaces make_group
- ContainerWidget replaces make_container
- Removed make_container, make_checkbox, now uses provided UI classes
- Prepared ModelConfig for model info
- Prepared InferenceConfig
- docstring update
- GroupedWidgets replaces make_group
- ContainerWidget replaces make_container
Fixed type errro
Fix argument name error
lint
- Added label for model input size
- Added warning when folder loading fails
- Replaced all large argument lists with dataclasses for clarity and robustness
@C-Achard C-Achard added the documentation Improvements or additions to documentation label Mar 15, 2023
@C-Achard C-Achard changed the title [WIP] Cy/interface overhaul Cy/interface overhaul Mar 15, 2023
@C-Achard C-Achard changed the title Cy/interface overhaul Interface overhaul Mar 15, 2023
@C-Achard C-Achard requested a review from jeylau March 27, 2023 09:00
Comment on lines +110 to +127
# head = msg.split(": ")[0]
# if type == QtWarningMsg and head == "QWindowsWindow::setGeometry":
# logger.warning(
# f"Qt resize error : {msg}\nhas been handled by attempting to resize the window"
# )
# try:
# if widget.parent() is not None:
# state = int(widget.parent().parent().windowState())
# if state == 0: # normal state
# widget.parent().parent().adjustSize()
# logger.debug("Non-max. size adjust attempt")
# logger.debug(f"{widget.parent().parent()}")
# elif state == 2: # maximized state
# widget.parent().parent().showNormal()
# widget.parent().parent().showMaximized()
# logger.debug("Maximized size adjust attempt")
# except RuntimeError:
# pass
Copy link
Contributor

Choose a reason for hiding this comment

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

This code wasn't functional?

Copy link
Collaborator Author

@C-Achard C-Achard Mar 28, 2023

Choose a reason for hiding this comment

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

It's not broken per se, but I've had two issues with it :

  • Inconsistency (it sometimes fails to do its job, maybe I missed a window status case, though usually it's when napari is maximized)
  • Causes ImportError when using PyQt6 as backend (this was the reason for commenting, it hindered testing of the plugin on other computers)

I could spend some time fixing it, but those resize errors seem to mainly occur on 4K screens (PyQt5's support of it is not perfect) and less so on more typical resolutions. I can check again on a 1080 screen

(Note to self : Maybe it'd be worth checking if it goes to the except block)

@C-Achard C-Achard merged commit cdc09de into main Mar 29, 2023
@C-Achard C-Achard deleted the cy/interface-overhaul branch December 5, 2023 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request UI Related to the UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants