Skip to content

BUG: Fix future warning on use of np.issubdtype. #707

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

jhlegarreta
Copy link
Contributor

Fix future warning on use of np.issubdtype. Fixes:

/home/travis/build/nipy/dipy/venv/lib/python3.4/site-packages/nibabel/streamlines/array_sequence.py:23:
FutureWarning: Conversion of the second argument of issubdtype from `bool`
to `np.generic` is deprecated. In future, it will be treated as `np.bool_
== np.dtype(bool).type`.

observed in projects using Nibabel, e.g. DIPY:
https://travis-ci.org/nipy/dipy/jobs/471947136

More information about the issue and the fix at:
numpy/numpy#2334
numpy/numpy#9505

@jhlegarreta
Copy link
Contributor Author

Not sure whether this will fix the issue/whether it is the right thing to do, though.

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.

The issue is that numpy.bool is bool, i.e., the Python type. The numpy boolean dtype is np.bool_.

@coveralls
Copy link

coveralls commented Dec 25, 2018

Coverage Status

Coverage remained the same at 91.828% when pulling fb76411 on jhlegarreta:FixNumpyissubdtypeMethodFutureWarningDeprecation into a995710 on nipy:master.

Fix future warning on use of `np.issubdtype`. Fixes:
```
/home/travis/build/nipy/dipy/venv/lib/python3.4/site-packages/nibabel/streamlines/array_sequence.py:23:
FutureWarning: Conversion of the second argument of issubdtype from `bool`
to `np.generic` is deprecated. In future, it will be treated as `np.bool_
== np.dtype(bool).type`.
```

observed in projects using Nibabel, e.g. DIPY:
https://travis-ci.org/nipy/dipy/jobs/471947136

More information about the issue and the fix at:
numpy/numpy#2334
numpy/numpy#9505
@jhlegarreta jhlegarreta force-pushed the FixNumpyissubdtypeMethodFutureWarningDeprecation branch from fbdd035 to fb76411 Compare December 25, 2018 16:12
@codecov-io
Copy link

Codecov Report

Merging #707 into master will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #707      +/-   ##
==========================================
+ Coverage   88.85%   88.88%   +0.03%     
==========================================
  Files          93       93              
  Lines       11454    11449       -5     
  Branches     1894     1892       -2     
==========================================
- Hits        10177    10176       -1     
+ Misses        936      933       -3     
+ Partials      341      340       -1
Impacted Files Coverage Δ
nibabel/streamlines/array_sequence.py 100% <ø> (ø) ⬆️
nibabel/viewers.py 96.66% <0%> (+1.25%) ⬆️

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 a995710...fb76411. Read the comment docs.

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. Thanks!

@effigies effigies merged commit 3652f16 into nipy:master Dec 26, 2018
@jhlegarreta jhlegarreta deleted the FixNumpyissubdtypeMethodFutureWarningDeprecation branch December 26, 2018 02:19
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