EV-21: test fixes (T41/T46 on base, test_ev20_writers T46 with the cut first)
checks / unit (pull_request) Successful in 47m29s
infra-pin / fresh (pull_request) Successful in 1s

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ems-agent
2026-11-25 17:26:38 +01:00
co-authored by Claude
parent 7bc8988be0
commit 36e9dd765e
2 changed files with 14 additions and 8 deletions
+9 -3
View File
@@ -218,10 +218,16 @@ check(f"T46: Solar starts on 1 phase (select at the start), then another "
s46[:1] and s46[0][2] == 1
and not [x for x in s46 if 140 < x[0] < 700])
low = [x for x in w46 if 140 < x[0] < 700]
# EV-21: with both batteries at the cut-out, the other writer's 3 phases
# take the period over the aim, so Solar's peak cut lowers the car first,
# within 1 cycle and at 690 W/A (EV-21 T34 (ii)); the 6 A hold and the pause
# follow. Every write in the stretch lowers; none waits for PHASE_GAP_S.
six = [x for x in low if x[1] == 6.0]
check(f"T46 (a)(b): the arithmetic uses the 3 phases the car draws on, and a "
f"lower current (the 6 A hold, the pause) is written within the 30 s "
f"rule, never blocked by PHASE_GAP_S ({w46})",
low and low[0][1] == 6.0 and low[0][0] <= 171
f"lower current (EV-21's cut, the 6 A hold, the pause) is written "
f"within the 30 s rule, never blocked by PHASE_GAP_S ({w46})",
low and six and six[0][0] <= 171 and low[0][0] <= 171
and all(b[1] < a[1] for a, b in zip(low, low[1:]))
and [a for _, a, _ in low][-1:] == [0.0])
imp46 = sum(max(0.0, x["grid"]) for x in r46["trace"]
if x["t"] > 140 and x["sp"] > 0)