-
Notifications
You must be signed in to change notification settings - Fork 10
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
Feature: a widget for setting Reader settings #63
base: main
Are you sure you want to change the base?
Feature: a widget for setting Reader settings #63
Conversation
Codecov ReportBase: 87.68% // Head: 85.50% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #63 +/- ##
==========================================
- Coverage 87.68% 85.50% -2.19%
==========================================
Files 4 4
Lines 203 200 -3
==========================================
- Hits 178 171 -7
- Misses 25 29 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
I think the lint error requires updating flake8 to >5... |
I've updated the widget based on @Czaki tips above, but sticking with magic_factory. In theory, could use the same approach as magicgui to look for the cached settings and read them, but not on widget load but instead on-load of the reader. This would make it more intuitive that the settings are set and forget, unless you want to change them. |
Yes, but on open of widget they will not be consistent with values from |
Not sure I follow. You mean if the user opens the widget but then doesn't click the button? |
Yes |
Right, I agree it could be confusing. |
Or stop using magic factory for something that is not a function as it is something that mutates global state. |
But mutating the global state is the goal of this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay. I just want to say this is so simple I love it!! Thanks for this. Few comments
@Czaki I personally think this is one of those: "in a perfect world where we have a lot of time on our hands", sure I agree with you, but the fact that this is so simple and works I think is pretty great. -- I personally haven't had the time to work on this lib or base aicsimageio in a long time so I will take what I can get. I guess we could write our own state manager but that sounds like overhead. Pinging @tlambert03 if you know of any easy tricks to solve. My only other comment on this unless we are presented with a better state management solution is that I think the state widget should be kept open after apply. And the button text should just be "Apply". |
it depends on what you want to have. I could provide some solution (simple use of The main decision is how to handle different versions of the library. Did you expect that state could strongly change in the new releases? |
These are good questions. And utilization of appdirs would be nice. After the opening of #67, maybe it makes sense to take a step back and form a single widget that manages all of this state. Not two widgets. Additionally to handle: "how we can grow the options that are managed by state". I know I will want to add more settings in the future. Particularly: "Chunk Dimensions: {user string}" (Defaults to ZYX). Sorry @psobolewskiPhD let me think a bit more on this. |
No problem! But the file specific stuff, that the Scene Management widget enables (unpack channels, clear) I like the way it is, where you can do it file by file. I just have a small monitor so #66 bites! Edit: to elaborate: some stuff I think should be global, like |
Made a comment here: https://forum.image.sc/t/napari-performance-on-a-tb-czi-image/84587/12 lets ignore any sort of persistance for now and at least get this out? |
can we add chunk dims tho |
This PR adds a second
contribution
to the plugin: a dock widget.The dock widget allows for setting some parameters that are used by the reader.
The aim is to address #29 but could be extend to #34
This is a WIP, at present it looks like:
Things to consider:
IN_MEMORY
tocore.py
and setting that as the default forin_memory
forreader_function
AUTOLOAD_FIRST_SCENE
tocore.py
and modify_get_scenes
to load the first scene based on this boolean setting.Delimiter
, should the white spaces be set by the user or appended to the string provided by the user?4. I'd like the widget to close itself when the user confirms/sets the settings, but this is still WIP—not sure how to accomplish it.DONEFeedback very welcome!
CC: @lambda-science