Explorar el Código

individual CRT1 spec for Ecuador. Fixed exception logging in CRF/T test reading

Johannes Gütschow hace 2 meses
padre
commit
3721d6897b

+ 2 - 0
src/unfccc_ghg_data/unfccc_crf_reader/crf_specifications/__init__.py

@@ -8,6 +8,7 @@ from .crf2023_aus_specification import CRF2023_AUS
 from .crf2023_specification import CRF2023
 from .crf2024_specification import CRF2024
 from .crt1_chl_specification import CRT1_CHL
+from .crt1_ecu_specification import CRT1_ECU
 from .crt1_pry_specification import CRT1_PRY
 from .crt1_specification import CRT1
 from .crt1_tun_specification import CRT1_TUN
@@ -20,6 +21,7 @@ __all__ = [
     "CRF2024",
     "CRT1",
     "CRT1_CHL",
+    "CRT1_ECU",
     "CRT1_PRY",
     "CRT1_TUN",
 ]

+ 18 - 0
src/unfccc_ghg_data/unfccc_crf_reader/crf_specifications/crt1_ecu_specification.py

@@ -0,0 +1,18 @@
+"""
+
+CRT1 specification for Chile.
+
+Header in Table3.B(b) differs. This is a quick fix. In the future the column matching
+should be improved to allow for different column names at least for ignored columns
+
+"""
+
+from copy import deepcopy
+
+from .crt1_specification import CRT1
+
+gwp_to_use = "AR5GWP100"
+
+CRT1_ECU = deepcopy(CRT1)
+# iognore NMVOC in table 4 as it has comma as decimal sep for 2000
+CRT1_ECU["Table4"]["table"]["cols_to_ignore"].append("NMVOC")

+ 4 - 3
src/unfccc_ghg_data/unfccc_crf_reader/crf_specifications/crt1_specification.py

@@ -871,7 +871,7 @@ CRT1 = {
                 ["1.A.3.b.i", "OFFOther"],
                 4,
             ],
-            ["\\C-CHL-SGP\\ NA", ["\\IGNORE", "\\IGNORE"], 4],
+            ["\\C-CHL-SGP-ECU\\ NA", ["\\IGNORE", "\\IGNORE"], 4],
             ["\\C-AUS-ECU\\ Lubricants", ["1.A.3.b.i", "OFFLubricants"], 4],
             ["\\C-AUT\\ FAME fossil part", ["1.A.3.b.i", "OFFBiodieselFC"], 4],
             ["\\C-SVN\\ Fossil part of biofuel", ["1.A.3.b.i", "OFFBiofuelFC"], 4],
@@ -945,7 +945,7 @@ CRT1 = {
                 ["1.A.3.b.ii", "OFFOther"],
                 4,
             ],
-            ["\\C-CHL-SGP\\ NA", ["\\IGNORE", "\\IGNORE"], 4],
+            ["\\C-CHL-SGP-ECU\\ NA", ["\\IGNORE", "\\IGNORE"], 4],
             ["\\C-AUS-ECU\\ Lubricants", ["1.A.3.b.ii", "OFFLubricants"], 4],
             ["\\C-AUT\\ FAME fossil part", ["1.A.3.b.ii", "OFFBiodieselFC"], 4],
             ["\\C-SVN\\ Fossil part of biofuel", ["1.A.3.b.ii", "OFFBiofuelFC"], 4],
@@ -4131,6 +4131,7 @@ CRT1 = {
             ["\\C-FRA\\ Reservoir of Petit-Saut in French Guiana", ["4.H.5"], 2],
             ["\\C-AUS-ECU\\ Aquaculture", ["4.H.10"], 2],
             ["\\C-AUS-ECU\\ Seagrass", ["4.H.11"], 2],
+            ["\\C-ECU\\ Biomass burning", ["4.H.12"], 2],
             [
                 "\\C-GUY-MDV-AZE-BTN-BRN-EGY-GNB-IDN-KEN-LBN-MYS-MUS-MAR-NAM-NGA-PAN-"
                 "URY-UZB\\ N2O emissions from aquaculture [IPCC Software 3.C.12]",
@@ -4143,7 +4144,7 @@ CRT1 = {
                 ["4.H.9"],
                 2,
             ],
-            ["\\C-SGP-NZL-LTU\\ Other", ["4.H.9"], 2],
+            ["\\C-SGP-NZL-LTU-ECU\\ Other", ["4.H.9"], 2],
             ["\\C-COL-HRV\\ 4.H. Other", ["4.H.9"], 2],
             ["\\C-BRA\\ Total", ["4.H.9"], 2],
             ["\\C-JPN\\ Concrete using Biochar", ["4.H.10"], 2],

+ 1 - 0
src/unfccc_ghg_data/unfccc_crf_reader/unfccc_crf_reader_devel.py

@@ -197,6 +197,7 @@ def read_year_to_test_specs(  # noqa: PLR0912, PLR0915
                     print(message)
                     exceptions.append(f"Error: {country_name}: {message}")
                     ds_table = None
+                    not_present = None
                     pass
 
                 try: