Skip to content

TST: (numpy dev) DeprecationWarning: __array_wrap__ must accept context and return_scalar arguments #15924

@neutrinoceros

Description

@neutrinoceros

Description

In this week's episode: a new deprecation warning !

see for example https://github.com/astropy/astropy/actions/runs/7609351554/job/20720426870?pr=15923

xref numpy/numpy#25409

"fixing" it could be as simple as adding a return_scalar argument to all implementations of __array_wrap__ but

  • I don't if the simplest fix will actually be portable (i.e., wouldn't it break with numpy 1.x ?)
  • We probably ought to do something with the new argument, not just accept it. At the moment I don't know how hard this'll be, but I'm working on it.

Expected behavior

No response

How to Reproduce

Install numpy dev, build pyerfa + astropy against it, then run (for instance)

pytest astropy/time/tests/test_precision.py

Versions

import platform; print(platform.platform())
import sys; print("Python", sys.version)
import astropy; print("astropy", astropy.__version__)
import numpy; print("Numpy", numpy.__version__)
import erfa; print("pyerfa", erfa.__version__)
#import scipy; print("Scipy", scipy.__version__)
#import matplotlib; print("Matplotlib", matplotlib.__version__)
macOS-14.2.1-arm64-arm-64bit
Python 3.12.0 (main, Oct 27 2023, 11:50:57) [Clang 15.0.0 (clang-1500.0.40.1)]
astropy 6.1.dev349+g1d9088ad03
Numpy 2.0.0.dev0+git20240122.89eac8b
pyerfa 2.0.1.2.dev11+gc498084

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions