-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
In Numpy the direct setting of the dtype, shape and strides attributes is being deprecated as these operations are not safe (in particular in the free-threading build). See numpy/numpy#28800 for details.
Most direct setting of the attributes can be replaced with alternatives like array.view(dtype=...) or array.reshape(new_shape). These alternatives have a minor performance penalty (since a new object has to be created), but in general these methods create a view so no data is copied.
The astropy.utils.masked.Masked might be a bit more complex to convert, but can perhaps be handled in the same was as the numpy MaskedArray.
Update: most changes are mechanical changes for which no detailed knowledge of numpy or astropy is required. For a short description on how to approach this see scipy/scipy#23522 (comment)