Give MBC test fixture's thermal unit a base power != system base#1650
Give MBC test fixture's thermal unit a base power != system base#1650luke-kiernan wants to merge 1 commit intomainSienna-Platform/PowerSimulations.jl:mainfrom lk/mbc-fixture-base-power-mismatchSienna-Platform/PowerSimulations.jl:lk/mbc-fixture-base-power-mismatchCopy head branch name to clipboard
Conversation
Test Unit1's device base_power previously equaled the system's base power (both 100 MVA), so per-unit multiplier bugs sensitive to that distinction (e.g. HydroPowerSimulations #136) went uncaught by tests built on this shared fixture, including the thermal/hydro MarketBidCost agreement test. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
This tweaks a test so it covers the bug from HPS #136. So until that gets merged, the MBC "compare hydro against thermal" test case should fail. Wouldn't be shocked if a couple other MBC tests fail too--there's some hand-tweaked numbers in those. |
|
Performance Results
|
Slight misunderstanding on my part: the test that failed lives in HPS and isn't the "compare hydro against thermal" one. But HPS's tests use PSI's helpers in Anyway, the details of the cross-package test failures check out and the change defends against regression as intended. |
There was a problem hiding this comment.
Pull request overview
Adjusts the shared load_sys_incr() MarketBidCost test fixture so “Test Unit1” uses a device base power different from the system base power, ensuring per-unit conversion paths are exercised and unit-conversion bugs aren’t masked in downstream tests (including consumers like HydroPowerSimulations).
Changes:
- Set “Test Unit1”
base_powerto1.4xthe system base power. - Preserve the unit’s natural-units (MW) rating/limits/dispatch by capturing and restoring values inside a
with_units_base(..., NATURAL_UNITS)block.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Give Test Unit1 a device base_power != system base_power, so unit-conversion bugs | ||
| # (e.g. rating-dependent per-unit multipliers) aren't masked by the two coinciding. |
Summary
load_sys_incr()'s "Test Unit1" had devicebase_power == get_base_power(sys)(both 100 MVA). Any per-unit multiplier bug that only shows up when a component's rating differs from system base power was invisible to every test built on this shared fixture, including the thermal/hydroMarketBidCostagreement test in both this repo andHydroPowerSimulations.jl.HydroGen's offer-curve breakpoint multiplier usedget_max_active_power(d)instead of the1.0every other device type uses, and the thermal/hydro-agree test couldn't catch it because the two bases coincided.1.4xsystem base, preserving its natural-units (MW) rating/limits/dispatch viawith_units_base(sys, NATURAL_UNITS).Test plan
load_sys_incr()standalone and confirmedunit1.base_power(140.0) now differs fromget_base_power(sys)(100.0)test/test_market_bid_cost.jl(full suite, not run here)