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

PendingDeprecationWarning from use of NumPy matrices #24

Closed
mdickinson opened this issue Jan 22, 2019 · 2 comments
Closed

PendingDeprecationWarning from use of NumPy matrices #24

mdickinson opened this issue Jan 22, 2019 · 2 comments

Comments

@mdickinson
Copy link

mdickinson commented Jan 22, 2019

We recently tracked down a PendingDeprecationWarning from our application test suite to the uses of np.asmatrix in this repository. I can't post the actual traceback here, but here's an example of the same effect (Python 3.7.2, NumPy 1.15.4):

mdickinson$ python -Wd
Python 3.7.2 (default, Dec 30 2018, 08:55:50) 
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.__version__
'1.15.4'
>>> np.asmatrix(np.ones((3, 3)))
/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/matrixlib/defmatrix.py:68: PendingDeprecationWarning: the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.
  return matrix(data, dtype=dtype, copy=False)
matrix([[1., 1., 1.],
        [1., 1., 1.],
        [1., 1., 1.]])

For convenience, the message text is:

PendingDeprecationWarning: the matrix subclass is not the recommended way to represent matrices or deal with linear algebra (see https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html). Please adjust your code to use regular ndarray.

@dme65
Copy link
Owner

dme65 commented Jan 26, 2019

Thank you for pointing this out. The issue has been fixed in v0.2.1.

@dme65 dme65 closed this as completed Jan 26, 2019
@mdickinson
Copy link
Author

Many thanks for the quick fix!

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