Skip to content

Conversation

@junukitashepard
Copy link

This adds both legacy reporting and new reporting capabilities for bilateralized trade.

Bilateralizing trade introduces new structures that are not compatible with the existing legacy reporting script.

This PR adds a new version of the legacy reporting (report/legacy/iamc_report_hackathon_trade.py), default tables (report/legacy/default_tables_trade.py), and post-processing scripts (report/legacy/postprocess_trade.py) to update reported tables to reflect updated import and export structures. This assumes that the user has bilateralized all default fuels (see below for list).

In addition, this adds new reporting for imports and exports, using updated reporting functionalities. These can be found in tools/bilateralize/reporting/new_reporting.py.

Users should view tools/bilateralize/reporting/reporting_workflow.py for an example of how both legacy and updated reporting can be used with the bilateralized structure.

Default bilateralized commodities

  • gas_piped
  • LNG_shipped
  • coal_shipped
  • crudeoil_shipped
  • crudeoil_piped
  • eth_shipped
  • foil_shipped
  • foil_piped
  • loil_shipped
  • loil_piped
  • biomass_shipped
  • lh2_shipped

How to review

  • Ensure that tools/bilateralize/reporting/reporting_workflow.py runs and produces outputs
  • All CI checks should pass

PR checklist

  • Continuous integration checks all ✅
  • Add or expand tests; coverage checks both ✅
  • Add, expand, or update documentation.
  • Update doc/whatsnew.

junukitashepard and others added 30 commits November 3, 2025 13:59
Add lines s.t. repo ignores bare, edit, and diagnostic files
This will get replaced with bilateralization documentation later
bilateralize.py now relies on the message_ix.make_df function rather than a user-defined function. Cuts down code ~120 lines.
In updated framework, flow technologies produce commodities (capacity) that are inputs to trade technologies, rather than using relation_activity to link flow-trade.
junukitashepard and others added 29 commits November 3, 2025 14:01
1) prepare_edit to generate edit files
2) bare_to_scenario to generate dictionary
3) load_and_solve to update scenario and optionally solve
Update formatting to pass mypy/ruff and allow testing
This removes the NEWPATHWAYS project version of documentation (same content)
Load and solve is now tested
Debug to load_and_solve.py (add "_")
Add encoding to prepare_edit.py
Increase coverage to GEM and MariTeam imports
Should be in separate GEM folder
Set scenario to a message_ix.Scenario for direct bialteralization in load_and_clone
Otherwise function uses start model/scenario from config.yaml
There is also option to name specific start model/scenario
Necessary for legacy reporting update
@yiyi1991 yiyi1991 added the report genno-based reporting and post-solve processing label Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

report genno-based reporting and post-solve processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants