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

FIX: Fix for NumPy deprecation #630

Merged
merged 2 commits into from
May 17, 2018
Merged

FIX: Fix for NumPy deprecation #630

merged 2 commits into from
May 17, 2018

Conversation

larsoner
Copy link
Contributor

Fixes this warning:

  /home/larsoner/custombuilds/nibabel/nibabel/freesurfer/mghformat.py:258: DeprecationWarning: In future, it will be an error for 'np.bool_' scalars to be interpreted as an index
    tzoom = (self['tr'],)[:self._ndims() > 3]

Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

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

LGTM. A readability suggestion that you're welcome to take or leave.

@@ -255,7 +255,7 @@ def get_zooms(self):
.. _mghformat: https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/MghFormat#line-82
'''
# Do not return time zoom (TR) if 3D image
tzoom = (self['tr'],)[:self._ndims() > 3]
tzoom = (self['tr'],)[:int(self._ndims() > 3)]
Copy link
Member

Choose a reason for hiding this comment

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

I think I wrote this, but looking at it, I think it's only a couple characters more to be a lot clearer in intent:

tzoom = (self['tr'],) if self._ndims() > 3 else ()

@codecov-io
Copy link

codecov-io commented May 17, 2018

Codecov Report

Merging #630 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #630   +/-   ##
=======================================
  Coverage   90.31%   90.31%           
=======================================
  Files          87       87           
  Lines       10816    10816           
  Branches     1794     1794           
=======================================
  Hits         9768     9768           
  Misses        719      719           
  Partials      329      329
Impacted Files Coverage Δ
nibabel/freesurfer/mghformat.py 95.53% <100%> (ø) ⬆️

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 68cf671...81b9cf7. Read the comment docs.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 93.352% when pulling 81b9cf7 on larsoner:fix-np into 68cf671 on nipy:master.

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