iterate_by_window#
- openstef_beam.evaluation.window_iterators.iterate_by_window(index: DatetimeIndex, window: Window, sample_interval: timedelta, reference_date: datetime | None = None) Iterator[tuple[datetime, DatetimeIndex]][source]#
Yields fixed-size sliding windows over a time series index.
Guarantees:
Windows are aligned to the window stride
Windows cover the entire range from index.min() + window.size to index.max()
Each window has exactly the specified window size
Window indices include timestamps from (end - window.size) to end (exclusive)
- Parameters:
index (
DatetimeIndex) – DatetimeIndex to create windows fromwindow (
Window) – Window specification with size, stride parameterssample_interval (
timedelta) – Time interval between consecutive samplesreference_date (
datetime|None) – Reference date for single window evaluation. When provided, yields a single window based on the reference date instead of all available windows.index
window
sample_interval
reference_date
- Yields:
Iterator of (window end time, window DatetimeIndex) tuples
- Return type: