Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated frequency alias A with Y #1930

Merged
merged 6 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading