diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1fb325df6..868e9acc7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -52,6 +52,7 @@ Internal changes * Added formatting for `Markdown` files. * Added the `bugbear`, `pyupgrade` checks to the `ruff` formatter. * Adjusted `mypy` checks to be more standardized. +* Renamed annual deprecated frequency alias `"A"` to `"Y"` (:pull:`1930`). CI changes ^^^^^^^^^^ diff --git a/tests/test_indicators.py b/tests/test_indicators.py index 04685218d..997d2719b 100644 --- a/tests/test_indicators.py +++ b/tests/test_indicators.py @@ -884,6 +884,6 @@ def test_freq_doc(): from xclim import atmos doc = atmos.latitude_temperature_index.__doc__ - allowed_periods = ["A"] + allowed_periods = ["Y"] exp = f"Restricted to frequencies equivalent to one of {allowed_periods}" assert exp in doc diff --git a/xclim/core/indicator.py b/xclim/core/indicator.py index 7c1f0ddac..97242c692 100644 --- a/xclim/core/indicator.py +++ b/xclim/core/indicator.py @@ -1495,7 +1495,7 @@ class ResamplingIndicator(CheckMissingIndicator): If None, this will be determined by the global configuration. allowed_periods : Sequence[str], optional A list of allowed periods, i.e. base parts of the `freq` parameter. - For example, indicators meant to be computed annually only will have `allowed_periods=["A"]`. + For example, indicators meant to be computed annually only will have `allowed_periods=["Y"]`. `None` means "any period" or that the indicator doesn't take a `freq` argument. """ diff --git a/xclim/core/utils.py b/xclim/core/utils.py index fcca4c3ef..5dff76c31 100644 --- a/xclim/core/utils.py +++ b/xclim/core/utils.py @@ -577,7 +577,6 @@ def adapt_clix_meta_yaml( # noqa: C901 """Read in a clix-meta yaml representation and refactor it to fit xclim's yaml specifications.""" from ..indices import generic # pylint: disable=import-outside-toplevel - # freq_names = {"annual": "A", "seasonal": "Q", "monthly": "M", "weekly": "W"} freq_defs = {"annual": "YS", "seasonal": "QS-DEC", "monthly": "MS", "weekly": "W"} if isinstance(raw, os.PathLike): diff --git a/xclim/indicators/atmos/_temperature.py b/xclim/indicators/atmos/_temperature.py index 661169468..d1efd311a 100644 --- a/xclim/indicators/atmos/_temperature.py +++ b/xclim/indicators/atmos/_temperature.py @@ -1383,7 +1383,7 @@ def cfcheck(self, tas, snd=None): "Mean temperature of warmest month multiplied by the difference of latitude factor coefficient minus latitude. " "Metric originally published in Jackson, D. I., & Cherry, N. J. (1988).", cell_methods="", - allowed_periods=["A"], + allowed_periods=["Y"], var_name="lti", compute=indices.latitude_temperature_index, parameters={"lat": {"kind": InputKind.VARIABLE}, "lat_factor": 60}, @@ -1419,7 +1419,7 @@ def cfcheck(self, tas, snd=None): "Botanical Gardens (ANBG) classification scheme divides categories into 5-degree Celsius zones, starting from -15 " "degrees Celsius and ending at 20 degrees Celsius.", cell_methods="", - allowed_periods=["A"], + allowed_periods=["Y"], var_name="hz", compute=indices.hardiness_zones, parameters={"method": "anbg"}, @@ -1440,7 +1440,7 @@ def cfcheck(self, tas, snd=None): "scheme divides categories into 10 degree Fahrenheit zones, with 5-degree Fahrenheit half-zones, " "starting from -65 degrees Fahrenheit and ending at 65 degrees Fahrenheit.", cell_methods="", - allowed_periods=["A"], + allowed_periods=["Y"], var_name="hz", compute=indices.hardiness_zones, parameters={"method": "usda"},