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

Address multiple deprecation warnings emerging at Python 3.12 #72

Open
sadielbartholomew opened this issue Aug 14, 2024 · 0 comments
Open
Assignees

Comments

@sadielbartholomew
Copy link
Member

The test suite is showing that there are at last a few deprecation warnings emerging from standard cf-plot code, which therefore probably needs to be updated accordingly in its use of numpy, matplotlib and perhaps other libraries too:

...
/home/slb93/miniconda3/envs/cf-env-312/lib/python3.12/site-packages/numpy/ma/core.py:5074: DeprecationWarning: Calling nonzero on 0d arrays is deprecated, as it behaves surprisingly. Use `atleast_1d(cond).nonzero()` if the old behavior was intended. If the context of this warning is of the form `arr[nonzero(cond)]`, just use `arr[cond]`.
  return narray(self.filled(0), copy=False).nonzero()
...
/home/slb93/miniconda3/envs/cf-env-312/lib/python3.12/site-packages/matplotlib/cbook.py:1699: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  return math.isfinite(val)
...

We should make updates to prevent any DeprecationWarning emerging.

@sadielbartholomew sadielbartholomew self-assigned this Aug 14, 2024
@sadielbartholomew sadielbartholomew changed the title Address multiple `deprecation warnings emerging at Python 3.12 Address multiple deprecation warnings emerging at Python 3.12 Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant