Skip to content

Commit

Permalink
using xarray default kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyCMWF committed Sep 7, 2023
1 parent 8a0832e commit 0f9d3af
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions earthkit/climate/aggregate/temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,6 @@ def resample(
frequency: str or int or float,
dim: str = "time",
how: str = "mean",
closed: str = "left",
label: str = "left",
skipna: bool = True,
**kwargs,
) -> xr.DataArray:
Expand All @@ -265,7 +263,7 @@ def resample(
The reduction method for resampling, default is `mean`
**kwargs
Keyword arguments to be passed to :func:`resample`. Defaults have been set as:
`{"closed": "left", "skipna": True, "label": "left"}`
`{"skipna": True}`
Returns
-------
Expand All @@ -274,7 +272,7 @@ def resample(
# Translate and xarray frequencies to pandas language:
frequency = tools._PANDAS_FREQUENCIES_R.get(frequency, frequency)
resample = dataarray.resample(
label=label, closed=closed, skipna=skipna, **{dim: frequency}, **kwargs
skipna=skipna, **{dim: frequency}, **kwargs
)
result = resample.__getattribute__(how)(dim)
return result
Expand Down

0 comments on commit 0f9d3af

Please sign in to comment.