Rename DAILY_MAINS_POWER to DAILY_POWER_SOURCE
The user's preferred name. The module becomes src/energy/power_source.py and the sheet docs/energy/analyses/daily_power_source.md; the calculation and the results are unchanged (D-043). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9177982de1
commit
997e842568
17 files changed
+54
-53
No files matched your search
@@ -12,7 +12,7 @@ sys.path.insert(0, str(Path(__file__).resolve().parents[1])) # src/ : paquets c
|
||||
from common.page import ROOT, open_html # noqa: E402 (bascule seule sur .venv si plotly manque)
|
||||
from common.stations import gaps, load_stations # noqa: E402
|
||||
import plotly.graph_objects as go # noqa: E402
|
||||
from energy import battery_state as bs, battery_trend as bt, day_color as dc, mains_power as mp # noqa: E402
|
||||
from energy import battery_state as bs, battery_trend as bt, day_color as dc, power_source as ps # noqa: E402
|
||||
from energy.final import STATE_STYLE, TREND_STYLE, noon # noqa: E402
|
||||
|
||||
# Statuts : noms et couleurs de la maquette System Summary (maquettes/user/summary_template.html).
|
||||
@@ -38,9 +38,9 @@ def summary(station, f):
|
||||
"""Résumé texte traçable : couleur, règle, faits de J−1 et de J, tendance et ce qui l'a décidée."""
|
||||
d, prev, cur = f["day"], f["prev"], f["cur"]
|
||||
lines = [f"{station}, {d:%d/%m/%Y}: {COLOR[f['color']][0]}"]
|
||||
if cur["power"] == "MAINS": # sur secteur, la perte du secteur décide (fiche daily_mains_power)
|
||||
lines.append(f" rule: on mains (3-day mean {cur['mean_3_days_v']} V ≥ {mp.MAINS_MEAN_V} V):"
|
||||
f" {cur['hours_lost']} h < {mp.MAINS_LOST_V} V → {f['color'] or 'unknown'}")
|
||||
if cur["power"] == "MAINS": # sur secteur, la perte du secteur décide (fiche daily_power_source)
|
||||
lines.append(f" rule: on mains (3-day mean {cur['mean_3_days_v']} V ≥ {ps.MAINS_MEAN_V} V):"
|
||||
f" {cur['hours_lost']} h < {ps.MAINS_LOST_V} V → {f['color'] or 'unknown'}")
|
||||
else:
|
||||
lines.append(f" rule: {dc.POWER_LABEL[cur['power']].lower()}, matrix state × trend (user manual § 7):"
|
||||
f" {cur['state']} × {cur['trend']} → {f['color'] or 'unknown'}")
|
||||
|
||||
Reference in new issue
Block a user