-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Labels
reportgenno-based reporting and post-solve processinggenno-based reporting and post-solve processing
Description
@junukitashepard found a limitation of this code:
message-ix-models/message_ix_models/report/__init__.py
Lines 153 to 162 in cb47229
| # Add standard renames | |
| info.setdefault("rename", {}) | |
| for dim, target in ( | |
| ("n", "region"), | |
| ("nl", "region"), | |
| ("y", "year"), | |
| ("ya", "year"), | |
| ("yv", "year"), | |
| ): | |
| info["rename"].setdefault(dim, target) |
The particular application was conversion of out:nd-nl-t-ya-c to 2 different quantities:
- For "Gross Exports":
- The
nl(i.e. the exporting node/region) dimension should be mapped to the IAMCregiondimension - The
nd(the importing region) dimension should be collapsed into the labels for the IAMCvariabledimension.
- The
- For "Gross Imports", it's the reverse:
- The
nddimension should be mapped to the IAMCregiondimension. - The
nldimension should be collapsed into the labels for the IAMCvariabledimension.
- The
The way the code currently sets the default existence and contents of the "rename" setting does not allow to do (2).
We identified a workaround, but to resolve on main:
- Add tests.
- Adjust the code.
- In Add reporting of resource extraction to IAMC structure #451, similar (simplified) code was added for in the .report.util.IAMCConversion class. I think it has the same limitations. In fixing this issue, I'd prefer to drop the function in report/__init__.py, or slim it down to simply chain to the class.
- Improve documentation.
Metadata
Metadata
Assignees
Labels
reportgenno-based reporting and post-solve processinggenno-based reporting and post-solve processing