Skip to content

ENH: Add ndim to ArrayProxy and DataobjImage #674

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
Oct 12, 2018

Conversation

effigies
Copy link
Member

@effigies effigies commented Oct 4, 2018

Closes #595.

@coveralls
Copy link

coveralls commented Oct 4, 2018

Coverage Status

Coverage increased (+0.007%) to 91.834% when pulling ce210bd on effigies:enh/arrayproxy_ndim into 7877add on nipy:master.

@codecov-io
Copy link

Codecov Report

Merging #674 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #674      +/-   ##
==========================================
+ Coverage   88.86%   88.87%   +<.01%     
==========================================
  Files          93       93              
  Lines       11378    11386       +8     
  Branches     1869     1869              
==========================================
+ Hits        10111    10119       +8     
  Misses        930      930              
  Partials      337      337
Impacted Files Coverage Δ
nibabel/ecat.py 85.87% <100%> (+0.08%) ⬆️
nibabel/minc1.py 90.06% <100%> (+0.12%) ⬆️
nibabel/arrayproxy.py 100% <100%> (ø) ⬆️
nibabel/parrec.py 94.36% <100%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7877add...ce210bd. Read the comment docs.

@effigies
Copy link
Member Author

effigies commented Oct 4, 2018

@cancan101 Would you like to test that this provides the interface(s) you were asking for?

@effigies effigies changed the title ENH: Add ndim to ArrayProxy protocol ENH: Add ndim to ArrayProxy and DataobjImage Oct 12, 2018
@effigies
Copy link
Member Author

@matthew-brett Up for a quick review? This is a pretty small change.

@matthew-brett
Copy link
Member

Thanks - yes - it looks fine. The only question is whether it's really worth adding the code for the benefit of going from ndim = dataobj.ndim to ndim = len(dataobj.shape). What do you think?

@effigies
Copy link
Member Author

I agree it's trivial. The advantage of the addition to ArrayProxy is that now ndim exists regardless of how the image is created. It's just a least surprise sort of thing. Passing it though to the image itself is less obviously simplifying, but what #595 originally asked about, so I went ahead and included it.

@matthew-brett
Copy link
Member

Then I'm fine with it, if you are ...

@effigies effigies merged commit 791678e into nipy:master Oct 12, 2018
@effigies effigies deleted the enh/arrayproxy_ndim branch October 12, 2018 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants