Skip to content

Commit

Permalink
fix units
Browse files Browse the repository at this point in the history
Signed-off-by: Trevor James Smith <[email protected]>
  • Loading branch information
Zeitsperre committed Jan 8, 2025
1 parent 86554e4 commit 04787cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/xclim/indices/_threshold.py
Original file line number Diff line number Diff line change
Expand Up @@ -3690,7 +3690,7 @@ def holiday_snow_days(

xmas_days = (snow_depth_constrained >= snow_depth_thresh).resample(time=freq).sum()

xmas_days = xmas_days.assign_attrs({"units": "1"})
xmas_days = xmas_days.assign_attrs({"units": "days"})
return xmas_days


Expand Down Expand Up @@ -3769,5 +3769,5 @@ def holiday_snow_and_snowfall_days(
.sum()
)

perfect_xmas_days = perfect_xmas_days.assign_attrs({"units": "1"})
perfect_xmas_days = perfect_xmas_days.assign_attrs({"units": "days"})
return perfect_xmas_days
4 changes: 2 additions & 2 deletions tests/test_snow.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def test_xmas_days_simple(self, nimbus):

out = land.holiday_snow_days(snd)

assert out.units == "1"
assert out.units == "days"
assert out.long_name == "Number of holiday days with snow"
np.testing.assert_array_equal(
out.sum(dim="time"),
Expand Down Expand Up @@ -166,7 +166,7 @@ def test_perfect_xmas_days_simple(self, nimbus):

out = land.holiday_snow_and_snowfall_days(snd, prsn)

assert out.units == "1"
assert out.units == "days"
assert out.long_name == "Number of holiday days with snow and snowfall"
np.testing.assert_array_equal(
out.sum(dim="time"),
Expand Down

0 comments on commit 04787cb

Please sign in to comment.