-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Don't allow negative contour values #5830
Conversation
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.
Makes sense to me!
It should also be fixed here: napari/napari/layers/labels/labels.py Lines 407 to 411 in 3868f5c
Im not sure if silent fixing should be applied or raise an exception. |
It looks like in other places (e.g. |
Codecov Report
@@ Coverage Diff @@
## main #5830 +/- ##
==========================================
+ Coverage 89.86% 89.92% +0.05%
==========================================
Files 615 615
Lines 52474 52478 +4
==========================================
+ Hits 47158 47189 +31
+ Misses 5316 5289 -27
|
# Fixes/Closes Fixes #5829 # Description This limits the contour spin box limits to exclude negative numbers. Negative values do not have any affect on the contouring and act the same as 0, so I think it makes sense to prevent users from setting negative values to avoid confusion. I couldn't obviously think of a test to add for this, but happy to dig further if required. # References <!-- What resources, documentation, and guides were used in the creation of this PR? --> ## Type of change <!-- Please delete options that are not relevant. --> - [ ] Bug-fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update # How has this been tested? <!-- Please describe the tests that you ran to verify your changes. --> - [ ] example: the test suite for my feature covers cases x, y, and z - [ ] example: all tests pass with my change - [ ] example: I check if my changes works with both PySide and PyQt backends as there are small differences between the two Qt bindings. ## Final checklist: - [ ] My PR is the minimum possible work for the desired functionality - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] If I included new strings, I have used `trans.` to make them localizable. For more information see our [translations guide](https://napari.org/developers/translations.html).
# Fixes/Closes Fixes #5829 # Description This limits the contour spin box limits to exclude negative numbers. Negative values do not have any affect on the contouring and act the same as 0, so I think it makes sense to prevent users from setting negative values to avoid confusion. I couldn't obviously think of a test to add for this, but happy to dig further if required. # References <!-- What resources, documentation, and guides were used in the creation of this PR? --> ## Type of change <!-- Please delete options that are not relevant. --> - [ ] Bug-fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update # How has this been tested? <!-- Please describe the tests that you ran to verify your changes. --> - [ ] example: the test suite for my feature covers cases x, y, and z - [ ] example: all tests pass with my change - [ ] example: I check if my changes works with both PySide and PyQt backends as there are small differences between the two Qt bindings. ## Final checklist: - [ ] My PR is the minimum possible work for the desired functionality - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] If I included new strings, I have used `trans.` to make them localizable. For more information see our [translations guide](https://napari.org/developers/translations.html).
# Fixes/Closes Fixes #5829 # Description This limits the contour spin box limits to exclude negative numbers. Negative values do not have any affect on the contouring and act the same as 0, so I think it makes sense to prevent users from setting negative values to avoid confusion. I couldn't obviously think of a test to add for this, but happy to dig further if required. # References <!-- What resources, documentation, and guides were used in the creation of this PR? --> ## Type of change <!-- Please delete options that are not relevant. --> - [ ] Bug-fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update # How has this been tested? <!-- Please describe the tests that you ran to verify your changes. --> - [ ] example: the test suite for my feature covers cases x, y, and z - [ ] example: all tests pass with my change - [ ] example: I check if my changes works with both PySide and PyQt backends as there are small differences between the two Qt bindings. ## Final checklist: - [ ] My PR is the minimum possible work for the desired functionality - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] If I included new strings, I have used `trans.` to make them localizable. For more information see our [translations guide](https://napari.org/developers/translations.html).
# Fixes/Closes Fixes #5829 # Description This limits the contour spin box limits to exclude negative numbers. Negative values do not have any affect on the contouring and act the same as 0, so I think it makes sense to prevent users from setting negative values to avoid confusion. I couldn't obviously think of a test to add for this, but happy to dig further if required. # References <!-- What resources, documentation, and guides were used in the creation of this PR? --> ## Type of change <!-- Please delete options that are not relevant. --> - [ ] Bug-fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update # How has this been tested? <!-- Please describe the tests that you ran to verify your changes. --> - [ ] example: the test suite for my feature covers cases x, y, and z - [ ] example: all tests pass with my change - [ ] example: I check if my changes works with both PySide and PyQt backends as there are small differences between the two Qt bindings. ## Final checklist: - [ ] My PR is the minimum possible work for the desired functionality - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] If I included new strings, I have used `trans.` to make them localizable. For more information see our [translations guide](https://napari.org/developers/translations.html).
Fixes/Closes
Fixes #5829
Description
This limits the contour spin box limits to exclude negative numbers. Negative values do not have any affect on the contouring and act the same as 0, so I think it makes sense to prevent users from setting negative values to avoid confusion.
I couldn't obviously think of a test to add for this, but happy to dig further if required.
References
Type of change
How has this been tested?
as there are small differences between the two Qt bindings.
Final checklist:
trans.
to make them localizable.For more information see our translations guide.