Align evening push with peak-band candidates and dynamic Wh budget.
Some checks failed
CI and deploy / migration-check (push) Failing after 23s
CI and deploy / deploy (push) Has been skipped

Restore _evening_peak_export_indices filter so push slots are chosen from
profitable peak-band nights, then ranked by sell until the Wh budget is
exhausted—not all profitable night slots and not a fixed top-3. Docs and
tests match v39 SoC balance tag.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Dusan Vojacek
2026-05-29 00:10:27 +02:00
parent ba0b55bf10
commit 620a557a89
4 changed files with 23 additions and 18 deletions

View File

@@ -1584,20 +1584,25 @@ def _evening_battery_export_push_indices(
evening_start_hour: int = 17,
) -> list[int]:
"""
Noční push: plný ge_bat v tolika nejdražších profitable slotech, kolik unese Wh rozpočet.
Noční push: plný ge_bat v tolika nejdražších peak-band slotech, kolik unese Wh rozpočet.
Kandidáti = profitable ∩ noční okno (≥17h + 05h do východu FVE). Řazení sell desc;
přidávat sloty dokud kumulované Wh ≤ push_budget (R__063: discharge_slot_buffer × SoC).
per_slot_discharge_wh = max_discharge × účinnost × 0,25 h; volající předává
min(discharge, export_cap × účinnost × 0,25 h) — home-01 export 13,5 kW ≈ 3,4 kWh/slot.
Kandidáti = profitable ∩ noční okno ∩ večerní peak pásmo (max sell v úseku degrad, R__063).
Řazení sell desc; přidávat sloty dokud kumulované Wh ≤ push_budget. Žádné pevné top-N.
per_slot_discharge_wh: volající předá min(BMS, export cap) × účinnost × 0,25 h.
"""
_ = degrad_czk_kwh, evening_start_hour # kompatibilita volání
if per_slot_discharge_wh <= 0.0:
return []
peak_ts = set(
_evening_peak_export_indices(
slots,
degrad_czk_kwh=degrad_czk_kwh,
evening_start_hour=evening_start_hour,
)
)
candidates = [
t
for t, s in enumerate(slots)
if _in_night_battery_export_window(s)
if t in peak_ts
and t in profitable_export_ts
and float(s.sell_price) >= 0.0
]