Skip to content
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

feat: return 3d support to v2 #83

Merged
merged 41 commits into from
Jan 16, 2025
Merged

feat: return 3d support to v2 #83

merged 41 commits into from
Jan 16, 2025

Conversation

tlambert03
Copy link
Member

@tlambert03 tlambert03 commented Jan 9, 2025

reopening #71 against main.

This adds back 3D (volume) views, with support for all gui frontends.

Currently, it just adds a "3D" button, which asks the DataWrapper to guess at which the next spatial ("Z") dimension is. But the api has the view tell the model what the new "visible axes" are; this leaves open the possibility in a later PR that the GUI will have more ability to select exactly which axes are used when showing a 3D view. (but that's for a later PR)

Copy link

codecov bot commented Jan 9, 2025

Codecov Report

Attention: Patch coverage is 70.83333% with 35 lines in your changes missing coverage. Please review.

Project coverage is 71.71%. Comparing base (dc59f7b) to head (d714dec).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/ndv/views/_wx/_array_view.py 45.83% 13 Missing ⚠️
src/ndv/views/_qt/_array_view.py 72.41% 8 Missing ⚠️
src/ndv/models/_data_wrapper.py 22.22% 7 Missing ⚠️
src/ndv/views/_jupyter/_array_view.py 66.66% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #83      +/-   ##
==========================================
- Coverage   71.83%   71.71%   -0.12%     
==========================================
  Files          43       43              
  Lines        4328     4430     +102     
==========================================
+ Hits         3109     3177      +68     
- Misses       1219     1253      +34     

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

@tlambert03
Copy link
Member Author

ok @gselzer, this now does the thing I wanted it to (as far as the end user is concerned). I didn't do too much stuff to have to make it work (though I did pass _ArrayDataDisplayModel to all the views... which can be changed later). Let me know if you can live with it for now

@@ -40,6 +40,8 @@ def __post_init__(self) -> None:
self.dtype = self.data.dtype


# NOTE: nobody particularly likes this class. It does important stuff, but we're
Copy link
Collaborator

Choose a reason for hiding this comment

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

Guilty as charged 🙈

@gselzer
Copy link
Collaborator

gselzer commented Jan 13, 2025

One small thing I noticed while testing - the histogram doesn't update when you go to 3D. If you bring this if block outside of the else I think things should work as intended.

Let me know if you can live with it for now

I can definitely live with it in the short term if it gets things working, since everything you changed is private API, no?

@tlambert03 tlambert03 merged commit c1be08a into pyapp-kit:main Jan 16, 2025
50 of 52 checks passed
@tlambert03 tlambert03 deleted the v2-3d branch January 16, 2025 13:43
@tlambert03 tlambert03 added the enhancement New feature or request label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants