Skip to content

Commit

Permalink
Apply suggestions from aulemahal
Browse files Browse the repository at this point in the history
Co-authored-by: Pascal Bourgault <bourgault.pascal@ouranos.ca>
  • Loading branch information
saschahofmann and aulemahal committed Sep 19, 2024
1 parent 2baad27 commit 14b44bd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
5 changes: 1 addition & 4 deletions xclim/indicators/atmos/_temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class Temp(Daily):
class TempHourly(Indicator):
"""Temperature indicators involving hourly temperature."""

src_freq = "H"
src_freq = "h"
keywords = "temperature"


Expand Down Expand Up @@ -1459,7 +1459,6 @@ def cfcheck(self, tas, snd=None):
title="Chill portions",
identifier="cp",
units="",
standard_name="chill_portions",
# TODO: check what this does
cell_methods="",
description="Chill portions are a measure to estimate the bud breaking potential of different crops. "
Expand All @@ -1484,8 +1483,6 @@ def cfcheck(self, tas, snd=None):
description="Chill units are a measure to estimate the bud breaking potential of different crops based on the Utah model developed in "
"Richardson et al. (1974). The Utah model assigns a weight to each hour depending on the temperature recognising that high temperatures can "
"actually decrease the potential for bud breaking.",
# TODO: check what this does
standard_name="chill_units",
long_name="Chill units after the Utah Model",
allowed_periods=["A"],
varname="cu",
Expand Down
7 changes: 3 additions & 4 deletions xclim/indices/_agro.py
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,8 @@ def chill_portions(tas: xarray.DataArray, freq: str = "YS") -> xarray.DataArray:
Returns
-------
xr.DataArray
xr.DataArray, [unitless]
Chill portions after the Dynamic Model
"""
tas_K: xarray.DataArray = convert_units_to(tas, "K")
return (
Expand Down Expand Up @@ -1637,7 +1638,5 @@ def chill_units(tas: xarray.DataArray, freq: str = "YS") -> xarray.DataArray:
),
),
)
.assign_attrs(units="")
.rename("cu")
)
return cu.resample(time=freq).sum()
return cu.resample(time=freq).sum().assign_attrs(units="")
2 changes: 1 addition & 1 deletion xclim/indices/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ def make_hourly_temperature(tasmin: xr.DataArray, tasmax: xr.DataArray) -> xr.Da
with tasmin reached at sunsrise and tasmax reached 2h before sunset.
For simplicity and because it's used for daily aggregation, we assume that sunrise globally happens at midnight
and the sunsets after `daylength` hours computed via the day_lengths function.
and the sunsets after `daylength` hours computed via the :py:func:`day_lengths` function.
Parameters
----------
Expand Down

0 comments on commit 14b44bd

Please sign in to comment.