From b89df553c0325b944d9203af073de65f356f3a20 Mon Sep 17 00:00:00 2001 From: Damien Irving Date: Fri, 20 Sep 2024 11:07:32 +1000 Subject: [PATCH] Update time_utils.py --- 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 1976327..33af528 100644 --- a/unseen/time_utils.py +++ b/unseen/time_utils.py @@ -152,7 +152,8 @@ def temporal_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) - assert ds[time_dim].values[0].month == start_time.month + months = ds[time_dim].dt.month.values + assert np.all(months == start_time.month), "Problem with time reset" if min_tsteps: # Drop first and last time points with insufficient time steps