Address multiple deprecation warnings emerging at Python 3.12
Open
@sadielbartholomew is already working on this.
Since Aug 14, 2024.
code hygiene
- Dominant language
- Python
- Stars
- 21
- Forks
- 11
- Avg merge
- 7h 11m
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.