Closed
Description
Describe the bug
When calling sunset_angle with an xarray object, I receive an error. I have mentioned it here: pydata/xarray#7848 (comment).
The problem is the compatibility of numpy and xarray in numpy 2.
It's likely the best way to solve this by checking for the type of data (xarray.DataArray), and then explicitly calling da.clip(-1,1)
, instead of numpy.clip(da, -1, 1)
.
This is the line of code that goes wrong:
Line 326 in ff41178
The error is: TypeError: DataWithCoords.clip() got an unexpected keyword argument 'out'
.
numpy version: 2.1.3
xarray version: 2025.1.2
pyet version: 1.3.1