Commit 64970ae
committed
fix: deduplicate DataFrame index before asfreq in _apply_df_freq_horizon
Prevents ValueError: cannot reindex on an axis with duplicate labels
when naive-mpc-optim is called with an InfluxDB backend whose time
window (due to UTC offsets) spans two calendar days, producing ~2x
the expected data points. The resulting concat of PV + load forecast
Series can carry duplicate timestamps that cause asfreq() to fail.
Uses the same ~df.index.duplicated() pattern already present in
set_df_index_freq() and prepare_data() elsewhere in the codebase.1 parent 38c83b3 commit 64970ae
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
736 | 736 | | |
737 | 737 | | |
738 | 738 | | |
| 739 | + | |
739 | 740 | | |
740 | 741 | | |
741 | 742 | | |
| |||
0 commit comments