Add oeo_9r_8d_base v2: fix one-way capacity_to_activity on inter-regional ties - #61
Merged
Merged
Conversation
…onal ties Temoa stores each inter-regional link as two one-way pseudo-regions and indexes capacity_to_activity by pseudo-region. Only one direction of each electricity tie carried a c2a row, so Temoa's Param default of 1 applied to the other direction instead of 31.536 PJ/(GW*year), while capacity is forced equal both ways. That direction could therefore carry ~3% of its rated capacity. Verified in the generated LP (constraint coefficient -3.9425 with the row present, -0.125 without) and by a controlled solve on temoa's test_system. The defect is inherited from the v3.1 source, where the rows are tagged "from PowerGenome", so it predates the v4 migration and is present in earlier published results. It does not bind in the no-carbon-price case, where the affected directions run under 5% of even their throttled ceiling. It binds under a carbon price: on N_CEN-MID_AT in 2050, flow sits at the artificial ceiling in 53 of 171 timeslices, and seven other ties run at 53-90% of theirs. v2 adds the 22 missing rows, each taking the value from its tie's populated direction. H2_TRANS_N is deliberately untouched: its capacity is denominated in PJ/year, so the default of 1 is correct there. Diff is 22 insertions, 0 deletions. Also sets latestVersion to v2, which the publish workflow does not update itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R5cg33nm9YtJQ37NVW3Xop
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe database diff adds 22 reverse-direction transmission capacity mappings. The manifest marks ChangesTransmission capacity corrections
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
What this fixes
Temoa stores each inter-regional link as two one-way pseudo-regions (
A-BandB-A) and indexescapacity_to_activityby pseudo-region. In this dataset only one direction of each electricity tie carried ac2arow — 11 rows covering 22 ordered pseudo-regions.capacity_to_activityis declaredParam(..., default=1)(temoa/core/model.py:386), so the unpopulated direction silently got 1 instead of 31.536 PJ/(GW·year), whilev_capacity['A-B'] == v_capacity['B-A']is enforced (temoa/components/geography.py:107). That direction could carry roughly 3% of its rated capacity.Evidence
Confirmed in the generated LP on Temoa's own
test_system:v_capacityc2arows presentAnd by a controlled solve: deleting the row on the load-carrying direction pinned flow to the capacity number in PJ and raised the objective.
Provenance
Inherited from the v3.1 source, where the rows are tagged
"from PowerGenome". This predates the v3→v4 migration and is present in earlier published results, so the v3↔v4 comparison is unaffected — both sides carry it.Does it matter?
N_CEN-MID_ATin 2050, flow sits at the artificial ceiling in 53 of 171 timeslices (observed 0.10827 = capacity 16.645 × segfrac 0.6244608/96 × c2a 1, matching to five significant figures). Seven other ties run at 53–90% of theirs.The change
22 rows added, each taking the value from its own tie's populated direction rather than a hardcoded constant.
H2_TRANS_Nis deliberately left alone — its capacity is denominated in PJ/year (cost_investunitsMUSD / (PJ / year)), so the default of 1 is correct there and patching it would have multiplied hydrogen pipeline throughput by 31.5×.Generated diff: 22 insertions, 0 deletions, all
capacity_to_activity.Note for maintainers
latestVersionis set tov2in this PR because the publish workflow'sfinalize_manifestnever updates that field — it would have gone stale from v2 onward for every dataset.pull --version latestreadshistory[0]so it resolves correctly either way, butlist-datasetsreports the stale field.Summary by CodeRabbit