-
Notifications
You must be signed in to change notification settings - Fork 1
Bugfix/fix layers changed deprecation #635
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
Author
|
test pass locally but fail on ci, checking |
saeliddp
reviewed
Sep 19, 2025
This reverts commit e22724a.
hughes036
reviewed
Sep 22, 2025
hughes036
reviewed
Sep 22, 2025
hughes036
reviewed
Sep 22, 2025
hughes036
approved these changes
Sep 22, 2025
Collaborator
hughes036
left a comment
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.
see comments about event super and using new fake more effectively.
saeliddp
approved these changes
Sep 22, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
This fixes
layer_changenapari event being deprecated.Some background- we developed the plugin to respond to a napari
layer_changeevent. Napari used to emit this event on any change to the layer list or any items inside napari's layer list, and we used this event to respond to sync ourFileInputWidgetup with the list of images available on the napari layer list.Now, napari seems to have gotten rid of the more general
layer_changeevent for more fine grained events that fire based on different changes to the layer list.The four events we need to be aware of are:
layers.events.inserted(image added)layers.events.removed(image removed)layers.events.moved(layer reordered)layers.events.changed(an existing layer modified)Changes
I made the smallest change possible, which was directly replacing the
layer_changeevent with the four events above that the plugin needs to be aware of when responding to changes in the layer list.A more ideal change would be to create dedicated handlers which respond to these changes individually, but this is a much bigger refactor. for now this keeps the plugin happy with the latest version of napari
Since we made this change, we can no longer use
layer_changeevents and we have to drop support for all napari versions< 0.6.2, which means we need to drop python 3.9 support as well (sincenapari==0.6.2only supports python 3.10 and above)Testing
Tested by installing fresh on windows, and running a full curation -> training -> prediction -> thresholding run.
How to review
Small change