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

not use np.matrix to fix PendingDeprecationWarning #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

curekoshimizu
Copy link

Under the followings environment, we can see PendingDeprecationWarning from numpy.

$ pip freeze
numpy==1.20.1
pyquaternion==0.9.9
$ python pyquaternion/test/test_quaternion.py
.....................................................pyquaternion/test/test_quaternion.py:310: 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.
  R = np.matrix(np.eye(3))
.pyquaternion/test/test_quaternion.py:334: 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.
  npm = np.matrix(m)
...............
----------------------------------------------------------------------
Ran 69 tests in 0.112s

OK

So, we should use ndarray instead of numpy.matrix.

ref. https://github.com/numpy/numpy/blob/master/numpy/matrixlib/defmatrix.py#L116-L121

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.

1 participant