Bug in eto_hargreaves function
Line 316 of eto.py in the eto_hargreaves() function should compare the sizes of the three input arrays, but only includes ".size" on the first boolean argument, resulting in an error when running function.
Current syntax:
if daily_tmin_celsius.size != daily_tmax_celsius != daily_tmean_celsius:
Correct syntax:
if daily_tmin_celsius.size != daily_tmax_celsius.size != daily_tmean_celsius.size:
Perhaps this wasn't an issue with certain dependency versions, but on python 3.12.8 I'm getting an error: "The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Please submit this in a PR. Thanks for your help!
This issue has been resolved by commit ed7c8f0.
The syntax error on line 314 (formerly 316) in eto.py has been corrected:
Before:
if daily_tmin_celsius.size != daily_tmax_celsius != daily_tmean_celsius:
After:
if not (daily_tmin_celsius.size == daily_tmax_celsius.size == daily_tmean_celsius.size):
The fix properly applies .size to all three array comparisons, eliminating the "truth value of an array with more than one element is ambiguous" error.
This was addressed as part of a broader fix for issue #578, which also corrected missing reshape_to_2d() calls for the tmin and tmax arrays in the Hargreaves calculation.
Thank you @njdepsky for reporting this issue!