You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the code was directly copied from dry_spell_max_length with all comparison operators inverted. But on that line, the comparison has to do with the number of days, so it should be ">=" instead. The current function completely inverts the run mask, so we get the longest run that is not a wet spell.
I'd note that a fast path for the window=1 case might be of interest here. Also, the documentation was not completely adapted when it was copied from dry_spell to wet_spell. For example, "max" as an "op" here makes no sense. It should be "min".
Contribution
I would be willing/able to open a Pull Request to address this bug.
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Setup Information
Description
Computing the wet spell max length spell turned out to be incorrect.
Steps To Reproduce
Returns : 321. The answer should be 5.
Additional context
The issue is here
xclim/xclim/indices/_threshold.py
Line 3520 in 994a5a1
It looks like the code was directly copied from
dry_spell_max_length
with all comparison operators inverted. But on that line, the comparison has to do with the number of days, so it should be ">=" instead. The current function completely inverts the run mask, so we get the longest run that is not a wet spell.I'd note that a fast path for the
window=1
case might be of interest here. Also, the documentation was not completely adapted when it was copied fromdry_spell
towet_spell
. For example, "max" as an "op" here makes no sense. It should be "min".Contribution
Code of Conduct
The text was updated successfully, but these errors were encountered: