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

BF: Fix NumPy warning when creating arrays from ragged sequences #2133

Merged

Conversation

jhlegarreta
Copy link
Contributor

Fix NumPy warning when creating arrays from ragged sequences in IVIM
reconstruction test.

Fixes

VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences
(which is a list-or-tuple of lists-or-tuples-or ndarrays with different
lengths or shapes) is deprecated. If you meant to do this, you must specify
'dtype=object' when creating the ndarray

triggered in
https://travis-ci.org/github/dipy/dipy/jobs/676101427#L5495

Rationale:
https://numpy.org/neps/nep-0034-infer-dtype-is-object.html

Copy link
Member

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

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

Thank you for this @jhlegarreta. I have one question, see below?

dipy/reconst/tests/test_ivim.py Outdated Show resolved Hide resolved
@skoudoro skoudoro added this to the 1.2 milestone Apr 19, 2020
@codecov
Copy link

codecov bot commented Apr 19, 2020

Codecov Report

Merging #2133 into master will increase coverage by 0.02%.
The diff coverage is 94.73%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2133      +/-   ##
==========================================
+ Coverage   91.18%   91.20%   +0.02%     
==========================================
  Files         249      251       +2     
  Lines       32037    32214     +177     
  Branches     3386     3401      +15     
==========================================
+ Hits        29213    29382     +169     
- Misses       2085     2091       +6     
- Partials      739      741       +2     
Impacted Files Coverage Δ
dipy/align/imwarp.py 98.39% <ø> (ø)
dipy/align/metrics.py 96.07% <ø> (ø)
dipy/align/streamlinear.py 85.25% <ø> (ø)
dipy/core/gradients.py 90.43% <90.69%> (-0.48%) ⬇️
dipy/core/tests/test_gradients.py 98.76% <97.95%> (+0.23%) ⬆️
dipy/align/tests/test_imaffine.py 99.38% <100.00%> (ø)
dipy/reconst/tests/test_ivim.py 98.02% <100.00%> (ø)
dipy/io/stateful_tractogram.py 68.85% <0.00%> (ø)
dipy/reconst/tests/test_peak_dg.py
... and 7 more

Fix NumPy warning when creating arrays from ragged sequences in IVIM
reconstruction test.

Fixes
```
VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences
(which is a list-or-tuple of lists-or-tuples-or ndarrays with different
lengths or shapes) is deprecated. If you meant to do this, you must specify
'dtype=object' when creating the ndarray
```

triggered in
https://travis-ci.org/github/dipy/dipy/jobs/676101427#L5495

Rationale:
https://numpy.org/neps/nep-0034-infer-dtype-is-object.html
@jhlegarreta jhlegarreta force-pushed the FixIVIMTestRaggedSequenceGenerationWarning branch from 9ab6929 to cae74f2 Compare April 19, 2020 02:07
@jhlegarreta
Copy link
Contributor Author

The failing travis build's issues are being tracked here #1821.

Otherwise, the warning this PR targets is no longer present.

@skoudoro
Copy link
Member

Thank you @jhlegarreta! LGTM, merging

@skoudoro skoudoro merged commit f76c084 into dipy:master Apr 19, 2020
@jhlegarreta jhlegarreta deleted the FixIVIMTestRaggedSequenceGenerationWarning branch April 19, 2020 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants