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
Fix casting uint32 to vispy dtype for image layers #6456
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6456 +/- ##
==========================================
- Coverage 92.23% 92.16% -0.07%
==========================================
Files 601 601
Lines 53167 53174 +7
==========================================
- Hits 49037 49009 -28
- Misses 4130 4165 +35 ☔ View full report in Codecov by Sentry. |
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.
@Czaki what do you think about adding the script to examples/dev
or examples/dev/issues
? We could make a habit of that because sometimes our tests don't capture the final behavior that we see in the canvas (see #6411 breaking direct color mode). So it would be nice to have a set of scripts that we can go back to to figure out when something untested broke.
extracted from #6439 Before this PR ![Zrzut ekranu z 2023-11-15 10-13-11](https://github.com/napari/napari/assets/3826210/34d16d83-5e36-4c95-8fd2-0527aae61370) After this PR ![Zrzut ekranu z 2023-11-15 10-20-24](https://github.com/napari/napari/assets/3826210/90f7f2ca-55dd-405b-9d22-05f6d79ddb77) Script to reproduce: ```python import numpy as np import napari nb_steps = 2**17 base = np.linspace(start=1, stop=nb_steps, num=nb_steps).astype('uint32') label_img = np.repeat( base.reshape([1, base.shape[0]]), int(nb_steps/1000), axis=0 ) viewer = napari.Viewer() viewer.add_image(label_img, colormap='viridis', contrast_limits=(0, nb_steps), scale=(100, 1)) napari.run() ``` --------- Co-authored-by: Juan Nunez-Iglesias <jni@fastmail.com>
extracted from #6439 Before this PR ![Zrzut ekranu z 2023-11-15 10-13-11](https://github.com/napari/napari/assets/3826210/34d16d83-5e36-4c95-8fd2-0527aae61370) After this PR ![Zrzut ekranu z 2023-11-15 10-20-24](https://github.com/napari/napari/assets/3826210/90f7f2ca-55dd-405b-9d22-05f6d79ddb77) Script to reproduce: ```python import numpy as np import napari nb_steps = 2**17 base = np.linspace(start=1, stop=nb_steps, num=nb_steps).astype('uint32') label_img = np.repeat( base.reshape([1, base.shape[0]]), int(nb_steps/1000), axis=0 ) viewer = napari.Viewer() viewer.add_image(label_img, colormap='viridis', contrast_limits=(0, nb_steps), scale=(100, 1)) napari.run() ``` --------- Co-authored-by: Juan Nunez-Iglesias <jni@fastmail.com>
References and relevant issues
extracted from #6439
Description
Before this PR
After this PR
Script to reproduce: