diff --git a/scripts/resample_daily.py b/scripts/resample_daily.py index 1172b07..e3cbc77 100644 --- a/scripts/resample_daily.py +++ b/scripts/resample_daily.py @@ -170,7 +170,7 @@ def main(argv: abc.Sequence[str]) -> None: orig_times.min() - np.timedelta64(rolling_window - 1, 'D'), orig_times.max() - np.timedelta64(rolling_window - 2, 'D'), dtype='datetime64[D]', - ) + ).astype('datetime64[ns]') elif METHOD.value == 'resample': if PERIOD.value[-1] == 'w': raise NotImplementedError( @@ -181,7 +181,7 @@ def main(argv: abc.Sequence[str]) -> None: orig_times.min(), orig_times.max() + np.timedelta64(1, 'D'), dtype='datetime64[D]', - ) + ).astype('datetime64[ns]') else: raise ValueError(f'Method {METHOD.value} not supported.') diff --git a/weatherbench2/utils.py b/weatherbench2/utils.py index 2cc327a..dd02e6c 100644 --- a/weatherbench2/utils.py +++ b/weatherbench2/utils.py @@ -39,7 +39,7 @@ def select_hour(ds: xr.Dataset, hour: int) -> xr.Dataset: # Select hour ds = ds.isel(time=ds.time.dt.hour == hour) # Adjust time dimension - ds = ds.assign_coords({'time': ds.time.astype('datetime64[D]')}) + ds = ds.assign_coords({'time': ds.time.astype('datetime64[ns]')}) return ds