Skip to content

Fix two ImportExportCost defects on Source - #242

Merged
jd-lara merged 1 commit into
mainfrom
jd/import-export-cost-fixes
Aug 18, 2026
Merged

Fix two ImportExportCost defects on Source#242
jd-lara merged 1 commit into
mainfrom
jd/import-export-cost-fixes

Conversation

@jd-lara

@jd-lara jd-lara commented Aug 18, 2026

Copy link
Copy Markdown
Member

No description provided.

Skip the unoffered side. The `isnothing(get_output_offer_curves(...))` guards
were dead: psy6 PSY defaults both offer curves to ZERO_OFFER_CURVE rather than
nothing, so a one-directional source got a block of PWL variables, a linking
constraint and objective terms priced at zero for the side it does not offer.
`IOM.is_nontrivial_offer` is the check the Storage sibling forty lines below
already used, and it handles the time-series-backed case too, so the FIXME's
stated blocker no longer held. The CATS import sources are import-only and hit
this.

Fix ImportExportBudgetConstraint under sub-hourly resolution.
`Dates.Hour(resolution).value` throws InexactError for any resolution that is
not a whole number of hours -- Settings normalises resolution to Milliseconds,
so a 5-minute model could not build the constraint at all. Uses
`Dates.value(resolution) / MILLISECONDS_IN_HOUR`, matching the four other
conversions in the codebase.

Each test fails without its own fix.
@jd-lara
jd-lara requested a review from luke-kiernan August 18, 2026 04:24
@github-actions

Copy link
Copy Markdown

Performance Results

Version Precompile Time
Main 5.255321898
This Branch 5.638612762
Version Build Time
Main-Build Time Precompile 83.84722921
Main-Build Time Postcompile 1.38207288
This Branch-Build Time Precompile 93.513380889
This Branch-Build Time Postcompile 1.102300363
Version Solve Time
Main-Solve Time Precompile 260.409457502
Main-Solve Time Postcompile 221.882209389
This Branch-Solve Time Precompile 135.711854523
This Branch-Solve Time Postcompile 90.905460555

@jd-lara
jd-lara merged commit 6e70267 into main Aug 18, 2026
2 of 6 checks passed
@jd-lara
jd-lara deleted the jd/import-export-cost-fixes branch August 18, 2026 15:45
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