From 3407ca1c0590c628cb9d7f311728929ee7131cfe Mon Sep 17 00:00:00 2001 From: Damien Irving Date: Fri, 20 Sep 2024 11:12:45 +1000 Subject: [PATCH] Add check for annual aggregation --- unseen/time_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unseen/time_utils.py b/unseen/time_utils.py index 33af528..c092143 100644 --- a/unseen/time_utils.py +++ b/unseen/time_utils.py @@ -52,7 +52,7 @@ def temporal_aggregation( agg_method, variables, season=None, - reset_times=False, + _times=False, min_tsteps=None, agg_dates=False, time_dim="time", @@ -149,6 +149,7 @@ def temporal_aggregation( ) if reset_times: + assert target_freq[0:2] == "YE", "--reset_times is for annual aggregation" diff = ds[time_dim].values[0] - start_time ds[time_dim] = ds[time_dim] - diff ds[time_dim] = ds[time_dim] + timedelta(days=1)