timeline: label columns 'no-bat meter' / 'with-bat meter' to avoid confusion

This commit is contained in:
Michiel Berger 2026-04-30 22:47:59 +02:00
parent 2f05a40d40
commit 10cc32ddc0

View file

@ -86,17 +86,17 @@ def main() -> None:
for date, day in win.groupby(win.index.date):
print(f"── {date} ────────────────────────────────────────────────────────────────")
print(f" {'hr':>2s} {'price':>5s} {'net (no bat)':>13s} "
f"{'charge':>7s} {'disch':>7s} {'SoC':>5s} {'grid':>7s} {'sav':>6s}")
print(f" {'hr':>2s} {'price':>5s} {'no-bat meter':>15s} "
f"{'charge':>7s} {'disch':>7s} {'SoC':>5s} {'with-bat meter':>16s} {'sav':>6s}")
for ts, r in day.iterrows():
net_no = r["demand_kwh"]
mark = "surplus" if net_no < -0.01 else "↑ import" if net_no > 0.01 else "·"
mark = "exp" if net_no < -0.01 else "↑ imp" if net_no > 0.01 else "·"
grid = r["grid_kwh_with_battery"]
grid_str = f"{grid:+6.2f}"
grid_mark = "↓ exp" if grid < -0.01 else "↑ imp" if grid > 0.01 else "·"
print(f" {ts.hour:02d}{r['eur_per_kwh']:.3f} "
f"{net_no:+8.2f} {mark:5s} "
f"{net_no:+7.2f} {mark:5s} "
f"{r['charge_kwh']:>6.2f} {r['discharge_kwh']:>6.2f} "
f"{r['soc_kwh']:>4.2f} {grid_str:>7s}{r['savings_eur']:+5.2f}")
f"{r['soc_kwh']:>4.2f} {grid:+8.2f} {grid_mark:5s}{r['savings_eur']:+5.2f}")
d_imp_no = max(0.0, day['demand_kwh'].clip(lower=0).sum())
d_exp_no = -day['demand_kwh'].clip(upper=0).sum()
d_imp_yes = day['import_kwh'].sum()