Skip to content

Commit

Permalink
BF: Fix NumPy warning when creating arrays from ragged sequences
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jhlegarreta committed Apr 19, 2020
1 parent 9dfa922 commit cae74f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dipy/reconst/tests/test_ivim.py
Expand Up @@ -185,7 +185,8 @@ def test_mask():
Test whether setting incorrect mask raises and error
"""
mask_correct = data_multi[..., 0] > 0.2
mask_not_correct = np.array([[False, True, False], [True, False]])
mask_not_correct = np.array([[False, True, False], [True, False]],
dtype=np.bool)

ivim_fit = ivim_model_trr.fit(data_multi, mask_correct)
est_signal = ivim_fit.predict(gtab, S0=1.)
Expand Down

0 comments on commit cae74f2

Please sign in to comment.