The first_day_below
and first_day_above
indices should be made into generics
#1175
Labels
Milestone
first_day_below
and first_day_above
indices should be made into generics
#1175
I think it would be a good idea to move the two
first_day
indices under_temperature.py
togeneric.py
so that we can construct better indicators out of them.Despite their docstrings being appropriate for general temperature data, they currently use
tasmin
in their call signature (since our regional focus largely concerns winter phenomena). For the wrapped indicators of these, it means that a dataset withtasmin
among its data_vars will have that variable used by default. This can be misleading when using the indicator and indice forms.If we were to move these over, I would elect to deprecate
first_day_above
andfirst_day_below
and propose the following replacement, undergeneric.py
:def first_day_below(da: xarray.DataArray, thresh: str = None, before_date: DayOfYearStr = "07-01", window: int = 1, freq: str = "YS",) -> xarray.DataArray
def first_day_below(da: xarray.DataArray, thresh: str = None, after_date: DayOfYearStr = "07-01", window: int = 1, freq: str = "YS",) -> xarray.DataArray
under
_temperature.py
:def first_day_above({tasmin | tas | tasmax}: xarray.DataArray, thresh: str = None, before_date: DayOfYearStr = "07-01", window: int = 1, freq: str = "YS",) -> xarray.DataArray
def first_day_below({tasmin | tas | tasmax}: xarray.DataArray, thresh: str = None, after_date: DayOfYearStr = "07-01", window: int = 1, freq: str = "YS",) -> xarray.DataArray
This would mean making some deprecation warnings for the existing indices/indicators, with breaking changes coming later.
The text was updated successfully, but these errors were encountered: