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

Resolve numpy deprecation: using matrix subclass instead of recommended ndarray #5532

Open
Tracked by #5466
ESadek-MO opened this issue Oct 5, 2023 · 0 comments
Open
Tracked by #5466

Comments

@ESadek-MO
Copy link
Contributor

ESadek-MO commented Oct 5, 2023

📰 Custom Issue

Written up from #5465.

Found within a couple tests. The tests seem to exist only to test a soon to be deprecated behaviour, so might just result in deleting the tests.
Relevant warnings below.

lib/iris/tests/unit/cube/test_Cube.py:78: 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.
    data = np.matrix([[1, 2, 3], [4, 5, 6]])

lib/iris/tests/unit/data_manager/test_DataManager.py::Test_data__setter::test_coerce_to_ndarray
lib/iris/tests/unit/data_manager/test_DataManager.py:463: 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.
    matrix = np.matrix(real_array)
@ESadek-MO ESadek-MO changed the title Resolve numpy deprecation warning: using matrix subclass instead of recommended ndarray Resolve numpy deprecation: using matrix subclass instead of recommended ndarray Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

1 participant