-
Notifications
You must be signed in to change notification settings - Fork 265
ENH: Remove img.get_data() from internal use #809
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
Conversation
83ff248
to
20df4c8
Compare
Codecov Report
@@ Coverage Diff @@
## master #809 +/- ##
=========================================
- Coverage 90.1% 90.1% -0.01%
=========================================
Files 96 96
Lines 11907 11906 -1
Branches 2124 2124
=========================================
- Hits 10729 10728 -1
Misses 833 833
Partials 345 345
Continue to review full report at Codecov.
|
9a712dd
to
a8d304a
Compare
a8d304a
to
c8d93e6
Compare
This is ready for a review. It's a lot of individual choices between As a rule, I went with the Tended to move to |
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.
Nice - thanks - I would have made the same decisions about where to go for np.asanyarray(img.dataobj)
.
nibabel/tests/test_image_api.py
Outdated
cache. Implement this as a no-op if ``get_fdata()``, ``get_data`` do not | ||
* ``img.uncache()`` (``img.get_fdata()`` and ``img.get_data()`` (deprecated) are | ||
allowed to cache the result of the array creation. If they do, this call empties | ||
that cache. Implement this as a no-op if ``get_fdata()``, ``get_data`` do not |
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.
Oops , missing parens in original, should be get_data() .
nibabel/tests/test_image_api.py
Outdated
* ``img.uncache()`` (``img.get_data()`` and ``img.get_data`` are allowed to | ||
cache the result of the array creation. If they do, this call empties that | ||
cache. Implement this as a no-op if ``get_fdata()``, ``get_data`` do not | ||
* ``img.uncache()`` (``img.get_fdata()`` and ``img.get_data()`` (deprecated) are |
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.
Can you think of phrasing that cannot imply get_fdata
is also deprecated?
@@ -150,19 +147,28 @@ def validate_filenames(self, imaker, params): | |||
# to_ / from_ filename | |||
fname = 'another_image' + self.standard_extension | |||
with InTemporaryDirectory(): | |||
img.to_filename(fname) | |||
rt_img = img.__class__.from_filename(fname) | |||
# Validate that saving or loading a file doesn't use deprecated methods internally |
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.
Nice
@matthew-brett Docs updated. Any last comments? |
Thanks - all good. |
Cool. Thanks for the review. |
Follow-up to #794. This removes almost all calls to
get_data()
from nibabel internals.The exception is
nibabel.nicom.dicomwrappers.*.get_data
, whereget_fdata()
hasn't been implemented (see #797).Begins by adding a regression test to reproduce #802.
Fixes #802.