Skip to content

Add oeo_9r_8d_base v2: fix one-way capacity_to_activity on inter-regional ties - #61

Merged
SutubraResearch merged 1 commit into
mainfrom
feat/oeo-9r-8d-base-v2
Aug 11, 2026
Merged

Add oeo_9r_8d_base v2: fix one-way capacity_to_activity on inter-regional ties#61
SutubraResearch merged 1 commit into
mainfrom
feat/oeo-9r-8d-base-v2

Conversation

@SutubraResearch

@SutubraResearch SutubraResearch commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

What this fixes

Temoa stores each inter-regional link as two one-way pseudo-regions (A-B and B-A) and indexes capacity_to_activity by pseudo-region. In this dataset only one direction of each electricity tie carried a c2a row — 11 rows covering 22 ordered pseudo-regions.

capacity_to_activity is declared Param(..., default=1) (temoa/core/model.py:386), so the unpopulated direction silently got 1 instead of 31.536 PJ/(GW·year), while v_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:

coefficient on v_capacity
both c2a rows present −3.9425 (= 31.54 × 0.125 segment fraction)
one row deleted −0.125 (= 1 × 0.125)

And 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?

  • No carbon price: no. The affected directions run under 5% of even their throttled ceiling, so the constraint is slack.
  • Under a carbon price: yes. On N_CEN-MID_AT in 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_N is deliberately left alone — its capacity is denominated in PJ/year (cost_invest units MUSD / (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

latestVersion is set to v2 in this PR because the publish workflow's finalize_manifest never updates that field — it would have gone stale from v2 onward for every dataset. pull --version latest reads history[0] so it resolves correctly either way, but list-datasets reports the stale field.

Summary by CodeRabbit

  • Data Updates
    • Added missing reverse-direction capacity values for 11 regional transmission ties.
    • Corrected exchange data using consistent populated-direction values.
  • Release Management
    • Updated the database artifact to version 2 with refreshed release metadata and pending-merge status.

…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
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9a367eb4-e5dc-467d-969c-921efe770912

📥 Commits

Reviewing files that changed from the base of the PR and between 08294b3 and 00b8e32.

📒 Files selected for processing (2)
  • diffs/oeo_9r_8d_base.sqlite/diff-v1-to-v2.diff
  • manifest.json

📝 Walkthrough

Walkthrough

The database diff adds 22 reverse-direction transmission capacity mappings. The manifest marks oeo_9r_8d_base.sqlite as version v2 and records its artifact metadata.

Changes

Transmission capacity corrections

Layer / File(s) Summary
Reverse-direction capacity mappings
diffs/oeo_9r_8d_base.sqlite/diff-v1-to-v2.diff
Adds 22 rows for 11 transmission ties under E_TRANS_N and E_TRANS_R. Each row uses 31.536 PJ / (GW * year) and includes provenance metadata.
Database version publication
manifest.json
Marks v2 as the latest version and adds its pending-merge history record with artifact metadata.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the v2 release and the correction to one-way capacity_to_activity rows on inter-regional ties.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/oeo-9r-8d-base-v2

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@SutubraResearch
SutubraResearch merged commit 20a4d39 into main Aug 11, 2026
5 checks passed
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.

1 participant