EV-20 review round 3: drop the if True wrapper in SolarWriter._close_a (cosmetic, no logic change)
checks / unit (pull_request) Successful in 30m34s
infra-pin / fresh (pull_request) Successful in 1s

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
EV-20 reviewer
2026-11-23 10:24:40 +01:00
parent cd8c393161
commit 5147c300b8
+11 -11
View File
@@ -917,17 +917,17 @@ class SolarWriter(ManualWriter):
return want
def _close_a(self, q, clamp, n_reported):
if True:
before = self.plan._before
if q.get("failed") and not q.get("sel") and before is not None:
return before[0] if before[0] >= CH.MIN_A else CH.MIN_A
a = self.amps_out(clamp) or CH.MIN_A
tgt = self.plan.target_w
for n in (q.get("n"), n_reported):
b = amps_for(tgt, n, clamp) if n in (1, 3) else None
if b is not None:
a = min(a, max(b, CH.MIN_A))
return a
"""`_seq_want`'s value, worked out once per sequence."""
before = self.plan._before
if q.get("failed") and not q.get("sel") and before is not None:
return before[0] if before[0] >= CH.MIN_A else CH.MIN_A
a = self.amps_out(clamp) or CH.MIN_A
tgt = self.plan.target_w
for n in (q.get("n"), n_reported):
b = amps_for(tgt, n, clamp) if n in (1, 3) else None
if b is not None:
a = min(a, max(b, CH.MIN_A))
return a
async def _begin_solar(self, drv, r, cur, n, now, tracker) -> None:
"""Step 1 of the safe sequence: 0 A (kept when it already stands).