Skip to content

[MAINT] Remove restrcition for Numpy 2.5 #140

Open

Description

@hoyer-a

Deprecations in numpy 2.5 are causing deprecation warnings in write_sofa and read_sofa, this also affects the pyfar tests (pyfar/pyfar#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

Activity

  1. mberz commented on Jun 30, 2026

    @mberz
    Member

    Looks like this might be an issue with how the python wrapper for netCDF implements slicing. Or what type is tmp_var?

  2. hoyer-a commented on Jun 30, 2026

    @hoyer-a
    MemberAuthor

    Yes, it's a netCDF4.Variable

  3. changed the title [-][MAINT] Numpy 2.5 deprecation warnings in `sofar.write_sofa` and `sofar.read_sofa`[/-] [+][MAINT] Numpy 2.5 deprecation warnings causd by netCDF4[/+] on Jun 30, 2026
  4. changed the title [-][MAINT] Numpy 2.5 deprecation warnings causd by netCDF4[/-] [+][MAINT] Numpy 2.5 deprecation warnings caused by netCDF4[/+] on Jun 30, 2026
  5. hoyer-a commented on Jul 17, 2026

    @hoyer-a
    MemberAuthor

    Should be fixed with next netCDF4 release

    Unidata/netcdf4-python#1469

  6. changed the title [-][MAINT] Numpy 2.5 deprecation warnings caused by netCDF4[/-] [+][MAINT] Remove restrcition for Numpy 2.5[/+] on Aug 27, 2026
  7. f-brinkmann commented on Aug 27, 2026

    @f-brinkmann
    Member

    We restricted to numpy <2.5.0 to be able to release sofar 1.3.0

  8. added a commit that references this issue on Oct 17, 2026
  9. added
    maintenance
    on Dec 2, 2026
  10. h-chmeruk commented on Dec 2, 2026

    @h-chmeruk

    What is the status of the issue?
    Is it on hold, is it ready for pickup, is it still under discussion?

  11. hoyer-a commented on Dec 2, 2026

    @hoyer-a
    MemberAuthor

    Implementation in progress, the issue with numpy >= 2.5 is fixed in #149

  12. moved this from Backlog to Implementation in progress in Weekly Planningon Dec 2, 2026
  13. h-chmeruk commented on Dec 2, 2026

    @h-chmeruk

    @hoyer-a, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenance

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions