v0.8.0 — current-gated active/standby load states + energy correction - #4
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
--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.energy_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.detect_ct_reversalnow decides on the dominant high-current state (not raw record count), robust for bimodal loads. Manual--reverse-ctsunchanged.active_records/duty_pct/kWh/PFcolumns added toshift_comparison.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