AllenCellModeling / napari-aicsimageio

Multiple file format reading directly into napari using pure Python
GNU General Public License v3.0
33 stars 10 forks source link

Bugfix: make Scene Management widget closable (settings persist) #67

Open psobolewskiPhD opened 1 year ago

psobolewskiPhD commented 1 year ago

This PR aims to fix https://github.com/AllenCellModeling/napari-aicsimageio/issues/66 When a multi-scene file is loaded, two widgets are created. One has two checkboxes, the other has the scenes to load. The status of the first widget (the checkboxes) is checked when the scenes are to be loaded. As a result, if that widget is closed an error is raised.

In this PR, the first widget instead sets global variables, so it need not be open. If the settings are applied, then the widget can be closed and scenes can be loaded. (this permits more vertical space for scene selection, particularly on smaller screens—like mine!) Additionally, the previous values are persisted thanks to magicgui.

codecov-commenter commented 1 year ago

Codecov Report

Base: 87.68% // Head: 87.29% // Decreases project coverage by -0.39% :warning:

Coverage data is based on head (be80320) compared to base (3898b66). Patch coverage: 83.33% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #67 +/- ## ========================================== - Coverage 87.68% 87.29% -0.40% ========================================== Files 4 3 -1 Lines 203 181 -22 ========================================== - Hits 178 158 -20 + Misses 25 23 -2 ``` | [Impacted Files](https://codecov.io/gh/AllenCellModeling/napari-aicsimageio/pull/67?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AllenCellModeling) | Coverage Δ | | |---|---|---| | [napari\_aicsimageio/core.py](https://codecov.io/gh/AllenCellModeling/napari-aicsimageio/pull/67/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AllenCellModeling#diff-bmFwYXJpX2FpY3NpbWFnZWlvL2NvcmUucHk=) | `83.60% <83.33%> (-2.22%)` | :arrow_down: | | [napari\_aicsimageio/\_\_init\_\_.py](https://codecov.io/gh/AllenCellModeling/napari-aicsimageio/pull/67/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AllenCellModeling#diff-bmFwYXJpX2FpY3NpbWFnZWlvL19faW5pdF9fLnB5) | | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AllenCellModeling). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AllenCellModeling)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

evamaxfield commented 1 year ago

To clarify. This PR should go in after the other merges correct? They are sort of tied together? Or is this a bug that currently exists?

psobolewskiPhD commented 1 year ago

This is just a fix for the bug/issue with the two-widget solution to multiscene files. Multiscene files open 2 widgets, with the scene selector needing values from the Scene Management widget. If that one is closed and a scene is selected from the selector widget, then the error is emitted.

It has nothing to do with the new settings widget. I guess I can see how it can be confusing...

Edit: note: I'm not sure this is the best or most pythonic fix. It's just a fix 😃