diff --git a/CHANGELOG.md b/CHANGELOG.md index 8550e4076..8b8cde3fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - use correct split of data with the `--eval val` or `--eval test` cli arguments [\#139](https://github.com/mllam/neural-lam/pull/139) @SimonKamuk +- Fix step length calculation when dt >= 24h [\#141](https://github.com/mllam/neural-lam/pull/141) @deinal + ### Maintenance - update ci/cd testing to use cuda 12.8 [\#140](https://github.com/mllam/neural-lam/pull/140) @SimonKamuk diff --git a/neural_lam/datastore/mdp.py b/neural_lam/datastore/mdp.py index f3a81b725..879f8575f 100644 --- a/neural_lam/datastore/mdp.py +++ b/neural_lam/datastore/mdp.py @@ -143,7 +143,8 @@ def step_length(self) -> int: """ da_dt = self._ds["time"].diff("time") - return (da_dt.dt.seconds[0] // 3600).item() + total_sec = da_dt.dt.total_seconds().isel(time=0).astype(int) + return (total_sec // 3600).item() def get_vars_units(self, category: str) -> List[str]: """Return the units of the variables in the given category.