temoa icon indicating copy to clipboard operation
temoa copied to clipboard

Documentation: Clarify group region constraints and exchange technology behavior

Open coderabbitai[bot] opened this issue 2 months ago • 0 comments

Context

A bug was identified and fixed in PR #180 where retirementPeriods lookups were using the aggregated region variable r instead of the concrete region reg, causing end-of-life emissions to be incorrectly dropped for grouped/global emission limits.

Related PR: #180 Related discussion: https://github.com/TemoaProject/temoa/pull/180#discussion_r2475486892

Documentation Needed

The documentation should clarify how group region constraints interact with exchange technologies:

  1. Group Region Constraints: When using group region constraints (e.g., r='Mexico+US+Canada'), exchange technology keys must be explicitly included in the region string for those flows to be counted.

  2. Exchange Technology Keys: For example, to properly constrain flows including exchange technologies between Mexico, US, and Canada, the region string would need to be: 'Mexico+US+Canada+Mexico-US+US-Mexico+US-Canada+Canada-US+Mexico-Canada+Canada-Mexico'

  3. Implicit Behavior: This is subtle behavior that users should be aware of when setting up emission limits or other constraints that use group regions.

Suggested Documentation Updates

  • Add a section explaining group region constraints in the relevant constraint documentation
  • Provide examples showing the proper format for region strings when exchange technologies are involved
  • Clarify the difference between individual regions, grouped regions, and 'global' constraints

Credit

Thanks to @idelder for identifying the subtle exchange technology behavior.

coderabbitai[bot] avatar Oct 30 '25 14:10 coderabbitai[bot]