-
Notifications
You must be signed in to change notification settings - Fork 10
allow mixed selections #422
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
Conversation
disregards unsupported layer types
for more information, see https://pre-commit.ci
…pari-clusters-plotter into allow-mixed-selections
for more information, see https://pre-commit.ci
…pari-clusters-plotter into allow-mixed-selections
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.
Pull Request Overview
This PR addresses issue #331 by modifying the handling of unsupported layer selections so that only supported layers are used in the cluster plotter, while unsupported ones are simply ignored. Key changes include:
- Removing individual coordinate calculations from the sample data and enabling the napari grid view.
- Adjusting layer selection and filtering logic in the plotter widget to work with the new behavior.
- Refactoring loops to iterate over the filtered self.layers instead of the complete layer selection.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/napari_clusters_plotter/_sample_data.py | Removed translation calculations and enabled grid view setup |
src/napari_clusters_plotter/_new_plotter_widget.py | Updated layer selection filtering and iterated over supported layers |
Comments suppressed due to low confidence (1)
src/napari_clusters_plotter/_new_plotter_widget.py:695
- [nitpick] The condition double-checks layer support even though earlier filtering already restricts self.layers. Consider refactoring to minimize redundant type checking, which could simplify maintenance.
if (layer in self.viewer.layers and type(layer) in self.input_layer_types):
Probably a missing feature update command in the widget init 🤔 |
Fixed in 4b293d9 |
Fixes #331
This PR makes some changes to how unsupported layers are treated upon selection. In essence, this PR changes this so that unsupported layers (e.g.,
Image
) are simply ignored. Previously, if an unsupported layer type is encountered in the selectionn/drawing process, the functions return and aborts so that nothing can be drawn. With this PR, a the clusters-plotter functionality is simply executed on the layers that are supported while the others are ignored.This can be especially helpful if layers arent't organized as stringently as in the
bbbc1
example dataset, where all the labels are on top and all the images are on the bottom. I just learned, that the napari grid view provides thestride
argument, which groupsn
layers together in a single grid tile, depending on the setting of thestride
parameter. This saves ourselves the trouoble of settingtranslate
values for the individual images in thebbbc1
dataset.