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

DeprecationWarning with scipy 1.8.0 #149

Closed
HippocampusGirl opened this issue Feb 18, 2022 · 4 comments
Closed

DeprecationWarning with scipy 1.8.0 #149

HippocampusGirl opened this issue Feb 18, 2022 · 4 comments

Comments

@HippocampusGirl
Copy link
Contributor

When using nitransforms version 20.0.0rc5, I get the following warnings with scipy 1.8.0

/usr/local/miniconda/lib/python3.10/site-packages/nitransforms/io/base.py:4: DeprecationWarning: Please use `get_matfile_version` from the `scipy.io.matlab` namespace, the `scipy.io.matlab.miobase` namespace is deprecated.
/usr/local/miniconda/lib/python3.10/site-packages/nitransforms/io/base.py:5: DeprecationWarning: Please use `MatFile4Reader` from the `scipy.io.matlab` namespace, the `scipy.io.matlab.mio4` namespace is deprecated.
/usr/local/miniconda/lib/python3.10/site-packages/nitransforms/io/base.py:6: DeprecationWarning: Please use `MatFile5Reader` from the `scipy.io.matlab` namespace, the `scipy.io.matlab.mio5` namespace is deprecated.

These point to the code here:

https://github.com/poldracklab/nitransforms/blob/d81d93ae07b980c2266880769da2b5a919d7b5a4/nitransforms/io/base.py#L5-L7

I would greatly appreciate if you could fix these :-) Thank you so much

@oesteban
Copy link
Collaborator

I'll try to get to this ASAP, but if you get ahead and submit a PR -- that will be very much appreciated (and speedy).

@HippocampusGirl
Copy link
Contributor Author

I just had a look, and my first question would be what is the purpose of the _read_mat method?

As far as I can tell, it's basically a re-implementation of scipy's loadmat (compare https://github.com/scipy/scipy/blob/b5d8bab88af61d61de09641243848df63380a67f/scipy/io/matlab/_mio.py#L73-L82).

Was there at some point a problem with scipy's loadmat?

@oesteban
Copy link
Collaborator

I just had a look, and my first question would be what is the purpose of the _read_mat method?

I believe there wasn't a loadmat at the time I wrote that - but it could be just that I didn't look hard enough. There's no particular reason not to use loadmat, I think.

@HippocampusGirl
Copy link
Contributor Author

Oh that makes sense, maybe they only introduced that later. In that case, I will remove _read_mat and send a pull request :-)

HippocampusGirl added a commit to HippocampusGirl/nitransforms that referenced this issue Feb 22, 2022
- Avoid `DeprecationWarning` if using the `MatFile4Reader`/`MatFile5Reader` classes directly
oesteban added a commit that referenced this issue Feb 22, 2022
FIX: Replace deprecated ``_read_mat`` with ``scipy.io.loadmat``

Resolves: #149
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

No branches or pull requests

2 participants