Skip to content

Commit

Permalink
Simpler input in wet test & typos
Browse files Browse the repository at this point in the history
  • Loading branch information
coxipi committed Jun 13, 2023
1 parent d7e7fea commit ad58ba7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 40 deletions.
38 changes: 2 additions & 36 deletions tests/test_indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -3417,43 +3417,9 @@ def test_wet_spell_max_length_indexer(pr_series):

def test_wet_spell_frequency_op(pr_series):
pr = pr_series(
np.array(
[
29.012,
0.1288,
0.0253,
0.0035,
4.9147,
1.4186,
1.014,
0.5622,
0.8001,
10.5823,
2.8879,
8.2635,
0.292,
0.5242,
0.2426,
1.3934,
0.0,
0.4633,
0.1862,
0.0034,
2.4591,
3.8547,
3.1983,
3.0442,
7.422,
14.8854,
13.4334,
0.0012,
0.0782,
31.2916,
0.0379,
]
)
np.array([10] + 5 * [0] + [10, 0.5, 0.5, 0.5, 10] + 5 * [0] + [10]),
units="mm/d",
)
pr.attrs["units"] = "mm/day"

test_sum = xci.wet_spell_frequency(pr, thresh="1 mm", window=3, freq="MS", op="sum")
test_max = xci.wet_spell_frequency(pr, thresh="1 mm", window=3, freq="MS", op="max")
Expand Down
4 changes: 2 additions & 2 deletions xclim/indicators/atmos/_precip.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ class HrPrecip(Hourly):
dry_spell_max_length = Precip(
title="Dry spell maximum length",
identifier="dry_spell_max_length",
long_name="Maximum consecutive number of days in a dry period of {window} days(s) or more, during which the {op} "
long_name="Maximum consecutive number of days in a dry period of {window} day(s) or more, during which the {op} "
"precipitation within windows of {window} day(s) is under {thresh}.",
description="The maximum {freq} number of consecutive days in a dry period of {window} day(s) or more"
", during which the {op} precipitation within windows of {window} day(s) is under {thresh}.",
Expand Down Expand Up @@ -674,7 +674,7 @@ class HrPrecip(Hourly):
wet_spell_max_length = Precip(
title="Wet spell maximum length",
identifier="wet_spell_max_length",
long_name="Maximum consecutive number of days in a wet period of {window} days(s) or more, during which the {op} "
long_name="Maximum consecutive number of days in a wet period of {window} day(s) or more, during which the {op} "
"precipitation within windows of {window} day(s) is equal or over {thresh}.",
description="The maximum {freq} number of consecutive days in a wet period of {window} day(s) or more"
", during which the {op} precipitation within windows of {window} day(s) is equal or over {thresh}.",
Expand Down
4 changes: 2 additions & 2 deletions xclim/indicators/atmos/_temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class TempWithIndexing(ResamplingIndicatorWithIndexing):
hot_spell_max_length = Temp(
title="Hot spell maximum length",
identifier="hot_spell_max_length",
long_name="Maximum consecutive number of days in a hot period of {window} days(s) or more, during which the "
long_name="Maximum consecutive number of days in a hot period of {window} day(s) or more, during which the "
"temperature within windows of {window} day(s) is above {thresh}.",
description="The maximum {freq} number of consecutive days in a hot period of {window} day(s) or more"
", during which the precipitation within windows of {window} day(s) is above {thresh}.",
Expand Down Expand Up @@ -505,7 +505,7 @@ class TempWithIndexing(ResamplingIndicatorWithIndexing):
cold_spell_max_length = Temp(
title="Cold spell maximum length",
identifier="cold_spell_max_length",
long_name="Maximum consecutive number of days in a cold period of {window} days(s) or more, during which the "
long_name="Maximum consecutive number of days in a cold period of {window} day(s) or more, during which the "
"temperature within windows of {window} day(s) is under {thresh}.",
description="The maximum {freq} number of consecutive days in a cold period of {window} day(s) or more"
", during which the precipitation within windows of {window} day(s) is under {thresh}.",
Expand Down

0 comments on commit ad58ba7

Please sign in to comment.