-
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
Fixing the problem #296
Fixing the problem #296
Conversation
for more information, see https://pre-commit.ci
Sure thats also a nice option and might require less code and avoid those errors popping up |
…om/BiAPoL/napari-clusters-plotter into Fixing-Layer-Dropdown-Preselection
for more information, see https://pre-commit.ci
…om/BiAPoL/napari-clusters-plotter into Fixing-Layer-Dropdown-Preselection
for more information, see https://pre-commit.ci
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #296 +/- ##
==========================================
+ Coverage 77.30% 77.32% +0.02%
==========================================
Files 16 16
Lines 1899 1901 +2
==========================================
+ Hits 1468 1470 +2
Misses 431 431 ☔ View full report in Codecov by Sentry. |
@@ -67,6 +67,9 @@ def layer_container_and_selection(): | |||
layer_select = create_widget(annotation=Layer, label="layer") | |||
layer_selection_container.layout().addWidget(layer_select.native) | |||
|
|||
if viewer is not None and viewer.layers.selection.active is not None: | |||
layer_select.value = viewer.layers.selection.active |
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.
I'm speculating this crashes when two layers are selected in napari?
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.
I tested this and at the moment when you select two layers the selection.active returns none. I’m guessing that might change some time in the future though but I’m not sure
This PR fixes #295. I do a quick check which layers have properties or features attached to them and we select the first one in the layer list.