SAFETY-125: a grid charge counts a late meter reading's seconds; the guard row says "over" when it is
A meter reading late near a quarter's end left seconds the projection did not count (SAFETY-99), and charge_headroom_w() read them as room: the cheap run (and price trading, and the N=2 maintenance charge) went back to full power in the quarter's last seconds and the quarter could land over a banked month peak or the cap. peakguard.charge_room_w() counts those seconds at the held reading for the charge only; the guard's floor is unchanged. The guard row said "idle, heading for 5 814 W, under this month's 5 413 W peak". Over the limit at the current rate the row and the month-peak line now say so, and that the grid charge is cut back. Version 0.19.2, CHANGELOG, DECISIONS. test_safety125.py new; the lag pins in test_price_run_fixes.py and test_opt20.py and the AST pin in test_arbitrage.py follow the change (see the pull request). Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
2932f3af39
commit
88ab8a50e3
@@ -963,7 +963,8 @@ def month_peak(c, now):
|
||||
ceiling = pg.ceiling_w or limit_w
|
||||
out["line"] = line_period(out["period_w"], ceiling, c.shadow,
|
||||
unmeasured=getattr(c, "peak_unmeasured_s", 0.0)
|
||||
> 0.0)
|
||||
> 0.0,
|
||||
cut=getattr(c, "room_charge", False))
|
||||
return out
|
||||
|
||||
|
||||
@@ -1367,13 +1368,19 @@ def line_peak_not_covered() -> str:
|
||||
return _t("peak_not_covered")
|
||||
|
||||
|
||||
def line_period(period_w, limit_w, shadow, unmeasured=False) -> str:
|
||||
def line_period(period_w, limit_w, shadow, unmeasured=False,
|
||||
cut=False) -> str:
|
||||
step = _w(shadow, "step_in", kw=_kw(limit_w))
|
||||
if unmeasured:
|
||||
# SAFETY-90: the add-on started during this period.
|
||||
return _t("period_unmeasured") + " " + step
|
||||
if period_w is None:
|
||||
return step
|
||||
if period_w > limit_w:
|
||||
# SAFETY-125: the figure is the current rate, and a grid charge is
|
||||
# what gets cut back.
|
||||
return _t("period_over", kw=_kw(period_w)) + " " + (
|
||||
_w(shadow, "charge_cut", kw=_kw(limit_w)) if cut else step)
|
||||
return _t("period", kw=_kw(period_w)) + " " + step
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user