Add bilateralization tool (project/newpathways-trade)#438
Conversation
|
Thanks for the work here! In order to merge the following are needed, and addressing these things first will help reviewers focus more squarely on the added contents and functionality.
Many members of the team have experience doing each of these steps and can help by checking work, pair programming, or joining in to do the changes directly, so please reach out on Slack or otherwise. |
ebeeb3c to
6a19239
Compare
341cdcb to
6e0b817
Compare
|
@khaeru Patch coverage is 51%; however, the scripts that are not covered in testing are those that derive input data based on private data sources. I would of course welcome any input on whether/how to increase this coverage. |
For bilateralize tool and tests
- Correct typo in .. currentmodule:: directive. - Use recommended section symbol hierarchy. - Extend section markup to match length of section title line. - Correct indentation, blank lines for bulleted lists. - Add recursive autosummary for the module code.
4f57a2e to
973ea5f
Compare
There was a problem hiding this comment.
Approved based on:
- Passing checks, notwithstanding codecov/patch as mentioned here.
- Comments by @yiyi1991, which I understand are captured at #460, #462 for follow-up in the next PR.
- Recent rebase and clean-up. In doing this I opened #476 for docs-related comments from November that still need to be addressed.
NB I have not reviewed the code in detail, as the number of commits and amount of added code is too large. But now that the module exists, we can be more particular about its contents as they are improved in future PRs.
I'll merge as soon as the checks pass.
Overview
The merged code allows users to represent trade bilaterally for specified commodities. By default, the tool bilateralizes existing fuel trade (e.g., oil_exp).
The bilateralization tool,
bilateralize, is generalized for any traded commodity, whether that is a fuel (e.g., LNG), or a material (e.g., steel). It also explicitly represents bilateral trade “flows”, or how a fuel/commodity is transported from exporter to importer. These flow technologies are user defined and flexible; the most common are pipelines (e.g., gas pipelines), maritime shipping (e.g., LNG tanker), and transmission lines.See https://github.com/iiasa/message-ix-models/blob/project/newpathways-trade/doc/api/tools-bilateralize.rst for more details on implementation.
How to review
Note: All scripts are additions (no existing scripts are amended). Therefore, I would request reviewing code directly rather than individual commits (of which there are >200).
These review steps are also outlined in https://github.com/iiasa/message-ix-models/blob/project/newpathways-trade/message_ix_models/tools/bilateralize/workflow.py
prepare_edit_files()should produce untracked files in commodity-specific directories indata/bilateralize/edit_filesand also transfer required parameter files todata/bilateralize/bare_filesbare_to_scenario()should produce a dictionary of required parameter updates for bilateralization for all specified trade commodities inconfig.yaml.load_and_solve()should be able to be used to update SSP base scenariosPR checklist