Skip to content

v0.8.0 — current-gated active/standby load states + energy correction - #4

Merged
GrumpyTanker merged 4 commits into
mainfrom
feat/active-standby-split
Jun 8, 2026
Merged

v0.8.0 — current-gated active/standby load states + energy correction#4
GrumpyTanker merged 4 commits into
mainfrom
feat/active-standby-split

Conversation

@GrumpyTanker

Copy link
Copy Markdown
Owner

Active/standby load-state split + energy fix

Stacked on the v0.7.0 shift-splitting PR. Motivated by the P115RE investigation: the rectifier load is bimodal (active coating draw vs low-current standby), and at standby the real-power sign is unreliable, which understated energy and produced a meaningless blended PF.

  • Current-gated classifier — active vs standby by mean phase current; --standby-threshold-a N (default 50 A).
  • load_states.{csv,json} comparison (per state: records, hours, duty %, kWh, P avg/min/max, I, S, PF, V, THD p95) + table in the report.
  • Three labeled energy figuresenergy_as_measured_kWh (unchanged historic), energy_active_kWh, energy_net_clip_standby_kWh — with the standby-sign caveat. Fixes the ~10% energy understatement without silently changing the old number.
  • Active-state PF headlined in narrative/summary/HTML (the blended whole-session PF is de-emphasized).
  • Magnitude-weighted reverse-CTs auto-decisiondetect_ct_reversal now decides on the dominant high-current state (not raw record count), robust for bimodal loads. Manual --reverse-cts unchanged.
  • active_records/duty_pct/kWh/PF columns added to shift_comparison.
  • Python↔JS parity for classifier + aggregation + energy figures.

Tests: Python 270 · Web 125, green. ES.004 validation: active 50.5% duty, +80.7 kW, PF 0.44; standby 16 A, −7.7 kW; energy 6,051 / 6,673 / 6,681 kWh; CT decision basis=active.

🤖 Generated with Claude Code

Bill Bai and others added 4 commits June 3, 2026 22:01
…tude-weighted reverse-CTs

Classify each record active vs standby by mean per-phase current (default
50 A, STANDBY_CURRENT_THRESHOLD_A). Add classify_load_states, load_state_rows,
session_energy (energy_as_measured / energy_active / energy_net_clip_standby),
and active_state_pf. Make detect_ct_reversal decide on the dominant high-current
(active) state for bimodal loads while keeping the whole-session count fields.
Add active_records/active_duty_pct/active_kWh/active_PF_avg to shift comparison
rows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…y in narrative+summary+HTML

CLI emits load_states.{csv,json} (per-state rows + the three energy figures +
the standby-sign caveat) alongside the other always-on artifacts. Add
--standby-threshold-a (default 50) and --load-states. The executive narrative,
summary.txt, and HTML report now headline the ACTIVE-state PF (de-emphasizing
the blended whole-session PF) and surface all three energy figures. The
shift_comparison CSV/JSON gains active_records/active_duty_pct/active_kWh/
active_PF_avg. The reverse-CTs notice keys off the active state. Golden
generator emits a load_states block for JS parity.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-weighted reverse-CTs

Port classifyLoadStates, loadStateRows, sessionEnergy, activeStatePf to
web/analysis.js; make detectCtReversal decide on the active (high-current)
state with active_* fields; add active_records/active_duty_pct/active_kWh/
active_PF_avg to shiftComparisonRows. Add a Python<->JS parity test
(load_states_parity.test.js) against the shared golden fixture.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rsion bump

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@GrumpyTanker
GrumpyTanker changed the base branch from feat/generalized-shifts to main June 8, 2026 19:31
@GrumpyTanker
GrumpyTanker merged commit 8ea914e into main Jun 8, 2026
2 checks passed
@GrumpyTanker
GrumpyTanker deleted the feat/active-standby-split branch June 8, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant