Skip to content

Commit

Permalink
Replace deprecated frequency alias A with Y (#1930)
Browse files Browse the repository at this point in the history
Simply replaces the now deprecated  annual frequency alias `A` with `Y`
  • Loading branch information
Zeitsperre authored Sep 20, 2024
2 parents f7a76f0 + 770d5c9 commit 1784307
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion tests/test_indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion xclim/core/indicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""

Expand Down
1 change: 0 additions & 1 deletion xclim/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions xclim/indicators/atmos/_temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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"},
Expand All @@ -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"},
Expand Down

0 comments on commit 1784307

Please sign in to comment.