Support scalar time-series cost params (shut_down/no_load) in unwrap_for_param#122
Merged
Conversation
…arams Time-series cost fields (shut_down / no_load and other scalar-linear sides of a MarketBidTimeSeriesCost) resolve per-hour to an IS.LinearFunctionData. The PWL slope/breakpoint unwrap_for_param methods don't match it, so it fell through the identity and _size_wrapper then called size(::LinearFunctionData) (no method), failing the parameter-population assert. Extract the scalar via get_proportional_term (mirrors the static _shutdown_cost_value path).
Contributor
|
Performance Results This branch |
jd-lara
approved these changes
Jun 24, 2026
jd-lara
added a commit
that referenced
this pull request
Jun 24, 2026
…arams (#122) (#123) Time-series cost fields (shut_down / no_load and other scalar-linear sides of a MarketBidTimeSeriesCost) resolve per-hour to an IS.LinearFunctionData. The PWL slope/breakpoint unwrap_for_param methods don't match it, so it fell through the identity and _size_wrapper then called size(::LinearFunctionData) (no method), failing the parameter-population assert. Extract the scalar via get_proportional_term (mirrors the static _shutdown_cost_value path). Co-authored-by: Rodrigo Henríquez-Auba <rodrigomha@gmail.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.
Summary
Adds the missing
unwrap_for_parammethod for scalar-linear time-series cost parameters, so aMarketBidTimeSeriesCost(andImportExportTimeSeriesCost) can be built under a unit-commitment model. Today the time-varying PWL offer-curve parameters are handled, but the scalar cost fields (shut_down,no_load, cost-at-min) are not.Problem
When a device carries a time-series offer cost, POM adds
ShutdownCostParameter/NoLoadCostParameteras time-series parameters. Their per-hour value resolves to anIS.LinearFunctionData.unwrap_for_paramhas methods only forAbstractPiecewiseLinearSlopeParameter/AbstractPiecewiseLinearBreakpointParameteroverIS.PiecewiseStepData, so the scalar element falls through to the identity method and_size_wrapperthen callssize(::LinearFunctionData), which has no method — failing the parameter-population assert in POMadd_parameters.jl.Minimal repro: build any UC
DecisionModelover aThermalStandardwhoseoperation_costis aMarketBidTimeSeriesCost.build!returnsFAILEDwithMethodError: no method matching size(::LinearFunctionData).Fix
Add one additive method that extracts the scalar from the per-hour
LinearFunctionDataviaIS.get_proportional_term— mirroring how the static path already reads a scalarLinearCurvecost (_shutdown_cost_value(::IS.LinearCurve) = IS.get_proportional_term(x)). The returnedFloat64hassize () == (), satisfying the existing assert.Dispatching on the element type covers all scalar cost parameters (shut_down / no_load / cost-at-min, incremental and decremental) in one method, with no signature changes to existing code.
Verification
Verified end-to-end with the downstream POM change (Sienna-Platform/PowerOperationsModels.jl device time-varying market-bid PR): a 24h time-varying
MarketBidTimeSeriesCostUC nowbuild!s andsolve!s, and the per-hour objective coefficients match the per-hour offer-curve slopes exactly (validated on both synthetic and real ERCOT DAM data).🤖 Generated with Claude Code