Skip to content

__array__ copy keyword DeprecationWarnings in indexing.py #9400

Open
@dcamron

Description

@dcamron

What is your issue?

Testing for the MetPy xarray accessor reveals warnings from indexing.py that parallel #9393 / #9312. There seem to be a few __array__ implementations that might need updating here and throughout.

on xarray-main@a04d857 and numpy==2.1,

import numpy as np
import xarray as xr
da = xr.tutorial.open_dataset("air_temperature")["air"]
np.array(da.variable._data)
DeprecationWarning: __array__ implementation doesn't accept a copy keyword, so passing copy=False failed. __array__ must implement 'dtype' and 'copy' keyword arguments.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions