Skip to content

Add region_id to ProcessFlow#1314

Draft
tsmbland wants to merge 1 commit into
flows_mapfrom
add_region_to_process_flow
Draft

Add region_id to ProcessFlow#1314
tsmbland wants to merge 1 commit into
flows_mapfrom
add_region_to_process_flow

Conversation

@tsmbland
Copy link
Copy Markdown
Collaborator

@tsmbland tsmbland commented May 26, 2026

Following on from #1311, this adds a region_id field to ProcessFlow so we can (in theory) represent flows between regions. More still to do (probably in separate PRs):

  • the inner map in ProcessFlowsMap is keyed by CommodityID, but we'll probably need to key this by (CommodityID, RegionID) to allow for multiple entries for the same commodity (i.e. out of one region and into another), or store as a vec
  • the graph code currently doesn't allow for the possibility of flows between regions
  • a way to build trade processes via the input files
  • a way to represent cross-region flows in the output data
  • possibly more?

It's quite fiddly though and I'm a bit uneasy about this. We need to switch all flow-related stuff that's currently relying on the asset's region to rely instead on the ProcessFlow region, but there's no compiler safety to protect against mistakes so will require a lot of care.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.71%. Comparing base (6723361) to head (e6263cb).

Additional details and impacted files
@@              Coverage Diff              @@
##           flows_map    #1314      +/-   ##
=============================================
+ Coverage      89.70%   89.71%   +0.01%     
=============================================
  Files             58       58              
  Lines           8481     8492      +11     
  Branches        8481     8492      +11     
=============================================
+ Hits            7608     7619      +11     
  Misses           566      566              
  Partials         307      307              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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