1515
1616#: Describe the conversion to IAMC structure.
1717CONV = IAMCConversion (
18- base = K .all [2 ],
18+ base = K .all [1 ],
1919 var_parts = ["Resource|Extraction" , "c" ],
2020 sums = ["c" ],
2121 unit = "EJ/yr" ,
2525
2626def callback (r : "Reporter" , context : "Context" ) -> None :
2727 """Prepare reporting of resource extraction."""
28- # TODO Generalize the following 3 blocks. Similar operations will be used in other
29- # cases.
28+ # TODO Generalize the following 3 calls to Reporter.add(), e.g. by a utility
29+ # function. Similar operations will be used in other cases.
3030
3131 # Apply missing units to model contents
3232 r .add (K .hist [0 ], "apply_units" , K .hist , units = "GWa/year" )
@@ -35,11 +35,8 @@ def callback(r: "Reporter", context: "Context") -> None:
3535 # Add historical and current values together
3636 r .add (K .all [0 ], "add" , K .hist [0 ], K .model [0 ])
3737
38- # Convert to target units
39- r .add (K .all [1 ], "convert_units" , K .all [0 ], units = CONV .unit )
40-
4138 # Aggregate on 'c' dimension using groups from commodity_groups()
42- r .add (K .all [2 ], "aggregate" , K .all [1 ], groups .c , keep = False )
39+ r .add (K .all [1 ], "aggregate" , K .all [0 ], groups .c , keep = False )
4340
4441 # Add tasks to (a) transform to IAMC-structured data, (b) concatenate to all::iamc
4542 CONV .add_tasks (r )
0 commit comments