From 14770acf321084de09988928f1d404f8eca145e5 Mon Sep 17 00:00:00 2001 From: Alexandra Udaltsova <43303448+AUdaltsova@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:28:59 +0100 Subject: [PATCH] Update find_contiguous_t0_time_periods.py --- ocf_datapipes/select/find_contiguous_t0_time_periods.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ocf_datapipes/select/find_contiguous_t0_time_periods.py b/ocf_datapipes/select/find_contiguous_t0_time_periods.py index 9701fb856..f7fd6f582 100644 --- a/ocf_datapipes/select/find_contiguous_t0_time_periods.py +++ b/ocf_datapipes/select/find_contiguous_t0_time_periods.py @@ -255,5 +255,6 @@ def find_contiguous_t0_periods_nwp( end_this_period = dt_init + max_staleness contiguous_periods += [[start_this_period, end_this_period]] - - return pd.DataFrame(contiguous_periods, columns=["start_dt", "end_dt"]) + contiguous_time_periods = pd.DataFrame(contiguous_periods, columns=["start_dt", "end_dt"]) + assert (contiguous_time_periods["start_dt"] <= contiguous_time_periods["end_dt"]).all() + return contiguous_time_periods