Skip to content

V1 issues 6 and 7#114

Merged
aclerc merged 6 commits into
v1from
v1-issue6
Jul 1, 2026
Merged

V1 issues 6 and 7#114
aclerc merged 6 commits into
v1from
v1-issue6

Conversation

@aclerc

@aclerc aclerc commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Add a minor improvement to power_model: clip predicted power to physically realistic range.
Improve comparison script to be able to evaluate improvements to power_model objectively.

@aclerc aclerc changed the base branch from main to v1 July 1, 2026 19:34
@aclerc aclerc changed the title V1 issue6 V1 issues 6 and 7 Jul 1, 2026
@aclerc aclerc requested a review from Copilot July 1, 2026 19:36
@aclerc aclerc marked this pull request as ready for review July 1, 2026 19:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens the physical realism of the PowerModelMethod by clipping counterfactual power predictions to a plausible range, and extends the study_power_model_compare workflow with an objective per-bin before/after view against the committed benchmark.

Changes:

  • Add prediction clipping in PowerModelMethod using a required baseline_rated_power_kw ceiling/floor policy, and update callers/tests accordingly.
  • Add a “conditional before/after” report to study_power_model_compare (CSV + overlay plots) that reconstructs the benchmark per-bin estimate from stored bias and compares per-bin |bias| changes with a shared materiality band.
  • Expose Hill of Towie baseline rated power as HOT_RATED_POWER_KW for consistent configuration across scripts.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/benchmarking/baselines/test_study_power_model_compare.py Adds unit/integration-style tests for the new conditional before/after table/overlay/tally behaviors and file outputs.
tests/benchmarking/baselines/test_power_model_method.py Updates PowerModelMethod construction with baseline_rated_power_kw and adds focused tests for _clip_predictions.
benchmarking/synthetic/sources/hill_of_towie.py Defines HOT_RATED_POWER_KW constant for Hill of Towie synthetic turbines.
benchmarking/synthetic/init.py Re-exports HOT_RATED_POWER_KW for convenient imports and adds it to __all__.
benchmarking/baselines/study_power_model_compare.py Introduces shared materiality band, per-bin before/after table + overlay frame, and wires the new report into main().
benchmarking/baselines/power_model/method.py Implements _clip_predictions, adds required baseline_rated_power_kw, and applies clipping to upgraded and validation predictions.
benchmarking/baselines/power_model/diagnostics.py Formatting-only adjustments (no behavior change).
benchmarking/baselines/inspect_prepost_hard_case.py Passes baseline_rated_power_kw into PowerModelMethod using HOT_RATED_POWER_KW.
benchmarking/baselines/example_toggle_study.py Passes baseline_rated_power_kw into PowerModelMethod using HOT_RATED_POWER_KW.
benchmarking/baselines/example_prepost_study.py Passes baseline_rated_power_kw into PowerModelMethod using HOT_RATED_POWER_KW.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

if schema != _BASELINE_SCHEMA:
msg = f"candidate {candidate_path} has schema {schema!r}, expected {_BASELINE_SCHEMA!r}; regenerate it."
raise ValueError(msg)
baseline_path.write_text(text)
Comment on lines +591 to +592
n_cells = int(merged[_METRIC_COLS].notna().all(axis=1).sum())

def tally(delta: pd.Series) -> str:
"""Count cells that moved beyond the noise floor: ``better`` (down) vs ``worse`` (up)."""
better = int((delta < -_IMPROVE_EPS).sum())
worse = int((delta > _IMPROVE_EPS).sum())
return f"{better} better / {worse} worse (of {n_cells})"
threshold = _MATERIAL_PP / _PP # tally works on fractional deltas; the band is defined in pp.
Comment on lines +412 to +414
# Baseline rated power of the Hill of Towie test turbines (kW); matches the synthetic generator's
# baseline ``rated_power_kw`` default and caps the power-model counterfactual predictions.
HOT_RATED_POWER_KW = 2300.0
@aclerc aclerc merged commit 071d3db into v1 Jul 1, 2026
@aclerc aclerc deleted the v1-issue6 branch July 1, 2026 20:40
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.

2 participants