pyfar / pyfar/sofar

[MAINT] Remove restrcition for Numpy 2.5

Open
#140 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
34
Forks
4
Avg merge
11m
Merged PRs (30d)
2

Description

Deprecations in numpy 2.5 are causing deprecation warnings in write_sofa and read_sofa, this also affects the pyfar tests (https://github.com/pyfar/pyfar/issues/943).
Not sure if we can fix this in our code or if this is an issue with netCDF4.

Warning:

...
sofar/io.py:256: in write_sofa
_write_sofa(filename, sofa, compression, verify=True)
sofar/io.py:331: in _write_sofa
tmp_var[:] = value
^^^^^^^^^^


???
E DeprecationWarning: Setting the shape on a NumPy array has been deprecated in NumPy 2.5.
E As an alternative, you can create a new view using np.reshape (with copy=False if needed).

src/netCDF4/_netCDF4.pyx:5616: DeprecationWarning

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in sofar/io.py at write_sofa and _write_sofa, especially the tmp_var[:] = value path shown in the warning. Reproduce the affected SOFA I/O or pyfar tests with NumPy 2.5 and determine whether the warning comes from sofar or netCDF4. Done means the NumPy 2.5 restriction is removed and the affected tests pass without the deprecation warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
backend, data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
56/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.