8000 Compare slice_key array instead of value for use with 4+D data by TimMonko · Pull Request #7879 · napari/napari · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Compare slice_key array instead of value for use with 4+D data #7879

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 4 commits into from
May 1, 2025

Conversation

TimMonko
Copy link
Contributor
@TimMonko TimMonko commented Apr 30, 2025

References and relevant issues

Closes #7878

Description

Compare array rather than value because slice_key[n] is array when greater than 3D.

Peter summarizes the issue/fix, nicely (thanks! I was scrambling between things)

I think this is correct based on poking around the slice_key code.
slice_key stores values of the the non-displayed dims, so for 3D array, slice_key is just a single value array and the comparison is easy. But for 4D+, its multiple values, so need to do an array comparison

@TimMonko
Copy link
Contributor Author

@psobolewskiPhD this fixes it for me. Can you test?

@TimMonko TimMonko added the bugfix PR with bugfix label Apr 30, 2025
@TimMonko TimMonko added this to the 0.6.0 milestone Apr 30, 2025
@psobolewskiPhD
Copy link
Member

Yes! 🙏

Copy link
Member
@psobolewskiPhD psobolewskiPhD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is correct based on poking around the slice_key code.
slice_key stores values of the the non-displayed dims, so for 3D array, slice_key is just a single value array and the comparison is easy. But for 4D+, its multiple values, so need to do an array comparison.
I will approve, but would be good to get @jni and/or @Czaki to take a look too!

@psobolewskiPhD
Copy link
Member
psobolewskiPhD commented Apr 30, 2025

OOO! a novel windows seg fault! It does appear unrelated though, so we can rerun once it allows us.

Copy link
codecov bot commented Apr 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.93%. Comparing base (b8f8814) to head (9d81277).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7879      +/-   ##
==========================================
+ Coverage   92.89%   92.93%   +0.04%     
==========================================
  Files         641      641              
  Lines       60366    60385      +19     
==========================================
+ Hits        56077    56121      +44     
+ Misses       4289     4264      -25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions bot added the tests Something related to our tests label May 1, 2025
@TimMonko
Copy link
Contributor Author
TimMonko commented May 1, 2025

based on how I had to set ShapeList.slice_key prior to adding the shapes for the tests to pass, I'm wondering if this is indicative of bad design. Couldn't slice_key be empty if the data is in 2D?
However, when I added broadcast protection to _update_displayed then it resulted in downstream bug after downstream bug because everything else assumed that displayed would abort early and no shapes would be displayed. I'm trying to figure out if slice_key could ever actually be practically empty though....

@jni
Copy link
Member
jni commented May 1, 2025

I'm wondering if this is indicative of bad design.

it is, we've had many discussions about how we need to remove slicing information from the layers. But definitely out of scope for this PR! 😂

@jni jni added the ready to merge Last chance for comments! Will be merged in ~24h label May 1, 2025
@jni
Copy link
Member
jni commented May 1, 2025

Thank you VERY MUCH @TimMonko for the fast fix, I first saw Peter's message about the failure on Zulip and I was like, omg if it's in 0.5.6 this is definitely going in 0.6.1 😂 but it will indeed be super-nice to have it in 0.6.0! 🚀

@jni jni merged commit df7516c into napari:main May 1, 2025
42 checks passed
@github-actions github-actions bot removed the ready to merge Last chance for comments! Will be merged in ~24h label May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix PR with bugfix tests Something related to our tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Shapes] ValueError spam on mouseover if 4D.
3 participants
0