Browse Source

fix a bug introduced with the last fix in the DI processing config; Fix a bug in the processing function

Johannes Gütschow 5 months ago
parent
commit
64896fe09c

+ 3 - 1
src/unfccc_ghg_data/helper/functions.py

@@ -225,7 +225,9 @@ def process_data_for_country(  # noqa PLR0913, PLR0912, PLR0915
                         }
                     )
                     if cat_name_present:
-                        cat_name = subtract_cats_current[cat_to_generate]["name"]
+                        cat_name = subtract_cats_current[cat_to_generate][
+                            "orig_cat_name"
+                        ]
                         data_agg = data_agg.assign_coords(
                             coords={
                                 "orig_cat_name": (

+ 2 - 2
src/unfccc_ghg_data/unfccc_di_reader/unfccc_di_reader_config.py

@@ -302,7 +302,7 @@ cat_conversion = {
             "1.B": "1.B",
             "1.B.1": "1.B.1",
             "1.B.2": "1.B.2",
-            # "2": "2",
+            "2": "M.2.BURDI",
             "2.A": "2.A",
             "2.B": "M.2.B_2.B",
             "2.C": "2.C",
@@ -340,7 +340,7 @@ cat_conversion = {
             },
             "2.H": {"sources": ["M.2.H.1_2", "2.H.3"], "orig_cat_name": "Other"},
             "2": {
-                "sources": ["2.A", "2.B", "2.C", "2.D", "2.F", "2.H"],
+                "sources": ["M.2.BURDI", "2.D"],
                 "orig_cat_name": "Industrial Processes and Product Use",
             },
             "3.A": {"sources": ["3.A.1", "3.A.2"], "orig_cat_name": "Livestock"},