sunset_angle uses numpy.clip
that is not compatible with numpy 2
#84
Labels
bug
Something isn't working
Milestone
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 ofnumpy.clip(da, -1, 1)
.This is the line of code that goes wrong:
pyet/pyet/meteo_utils.py
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
The text was updated successfully, but these errors were encountered: