Prechádzať zdrojové kódy

[DATALAD] Recorded changes

Daniel Busch 3 mesiacov pred
rodič
commit
d7794df0e3

+ 1 - 1
src/faostat_data_primap/read.py

@@ -238,7 +238,7 @@ def read_data(  # noqa: PLR0915 PLR0912
     data_if = data_pm2.pr.to_interchange_format()
 
     # save raw data
-    output_filename = f"FAOSTAT_Agrifood_system_emissions_{release_name}"
+    output_filename = f"FAOSTAT_Agrifood_system_emissions_{release_name}_raw"
 
     if not save_path.exists():
         save_path.mkdir()

+ 8 - 6
tests/unit/test_conversion.py

@@ -42,6 +42,7 @@ def test_conversion_from_FAO_to_IPCC2006_PRIMAP():
     ds_if = ds.pr.to_interchange_format()
 
     da_dict = {}
+
     for var in gases:
         da_dict[var] = ds[var].pr.convert(
             dim="category (FAOSTAT)",
@@ -50,6 +51,7 @@ def test_conversion_from_FAO_to_IPCC2006_PRIMAP():
         )
 
     result = xr.Dataset(da_dict)
+    result.attrs = ds.attrs
 
     result_if = result.pr.to_interchange_format()
 
@@ -81,13 +83,13 @@ def test_conversion_from_FAO_to_IPCC2006_PRIMAP():
 
 def test_read(tmp_path):
     domains_and_releases_to_read = [
-        # ("farm_gate_agriculture_energy", "2024-11-14"),
+        ("farm_gate_agriculture_energy", "2024-11-14"),
         ("farm_gate_emissions_crops", "2024-11-14"),
-        # ("farm_gate_livestock", "2024-11-14"),
-        # ("land_use_drained_organic_soils", "2024-11-14"),
-        # ("land_use_fires", "2024-11-14"),
-        # ("land_use_forests", "2024-11-14"),
-        # ("pre_post_agricultural_production", "2024-11-14"),
+        ("farm_gate_livestock", "2024-11-14"),
+        ("land_use_drained_organic_soils", "2024-11-14"),
+        ("land_use_fires", "2024-11-14"),
+        ("land_use_forests", "2024-11-14"),
+        ("pre_post_agricultural_production", "2024-11-14"),
     ]
 
     read_data(