[MAINT] Remove restrcition for Numpy 2.5

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

@f-brinkmann is already working on this.

Since Oct 24, 2026.

  • #149 by @f-brinkmann — open

Assessment

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

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.

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

Dominant language
Python
Stars
37
Forks
4
PR merge metrics
No merged PRs in 30d

Getting set up

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.

More from pyfar/sofar

All issues in pyfar/sofar

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.