Skip to content

Commit

Permalink
Merge pull request #354 from openclimatefix/nwp-timesel-check
Browse files Browse the repository at this point in the history
Check start_time < end_time when selecting valid nwp t0 slices
  • Loading branch information
AUdaltsova authored Aug 9, 2024
2 parents 17289a1 + 14770ac commit 6661ec3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ocf_datapipes/select/find_contiguous_t0_time_periods.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6661ec3

Please sign in to comment.