Skip to content

Simplify frame filtering logic in year_limited decorator - #507

Open
Tijoxa wants to merge 1 commit into
EnergieID:masterfrom
Tijoxa:master
Open

Simplify frame filtering logic in year_limited decorator#507
Tijoxa wants to merge 1 commit into
EnergieID:masterfrom
Tijoxa:master

Conversation

@Tijoxa

@Tijoxa Tijoxa commented Jan 23, 2026

Copy link
Copy Markdown

Replace separate first-frame tracking with check against frames list. Filter subsequent frames by comparing against the last frame's max index instead of using start/end bounds, and only append non-empty results.

Fixes #388

Since all the queries return DatetimeIndex, we can just select datetimes that are greater thant the last max index.

But to ensure that this is the case, we can do additional checks:

if not frames or not isinstance(df.index, pd.DatetimeIndex):
    interval_mask = frame.index
else:
    interval_mask = frame.index > max(frames[-1].index)

Replace separate first-frame tracking with check against frames list.
Filter subsequent frames by comparing against the last frame's max index
instead of using start/end bounds, and only append non-empty results.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Day Ahead Prices is missing 1 row due to DST

1 participant