TARIFF-24 forward-port: part 6 reads its last row through nth() (test_named_absence)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
1c9fefd9dd
commit
60a3fa615e
@@ -444,12 +444,13 @@ TEN = datetime(2026, 10, 30, 22, 0, tzinfo=L).astimezone(timezone.utc)
|
||||
c4, r4 = drive(opts(0.07), fc=lambda t: "fresh" if t < 300.0 else "gone",
|
||||
minutes=60, t0=T_R4)
|
||||
_held4 = [r for r in r4 if r["held"]]
|
||||
_l4 = nth(r4, -1, "last cycle")
|
||||
print(f" R4: forecast lost 21:45; held {len(_held4)} cycles, to "
|
||||
f"{r4[-1]['free_to']}; after 22:00 on={ {r['runs_on'] for r in r4 if r['now'] >= TEN} } "
|
||||
f"{_l4['free_to']}; after 22:00 on={ {r['runs_on'] for r in r4 if r['now'] >= TEN} } "
|
||||
f"charging {sum(r['charging'] for r in r4)}")
|
||||
check("R4, forecast lost before the next run: while only the day's give run "
|
||||
"was under way the hold is that run's end, 22:00, and stays there",
|
||||
present(nth(r4, -1)) and all(r["free_to"] == TEN for r in r4
|
||||
present(_l4) and all(r["free_to"] == TEN for r in r4
|
||||
if r["t"] >= 5.0)
|
||||
and bool(_held4) and all(r["now"] < TEN for r in _held4))
|
||||
check("R4: from 22:00 the night's cheap run needs the wider gap: "
|
||||
|
||||
Reference in New Issue
Block a user