Ver Fonte

add test reading to doit

Johannes Gütschow há 1 ano atrás
pai
commit
2c4b339805
1 ficheiros alterados com 25 adições e 0 exclusões
  1. 25 0
      dodo.py

+ 25 - 0
dodo.py

@@ -201,6 +201,8 @@ read_config_crf = {
     "submission_date": get_var('submission_date', None),
     "submission_date": get_var('submission_date', None),
     "re_read": get_var('re_read', False),
     "re_read": get_var('re_read', False),
     "countries": get_var('countries', None),
     "countries": get_var('countries', None),
+    "data_year": get_var('data_year', None),
+    "totest": get_var('data_year', None),
 }
 }
 
 
 def task_read_unfccc_crf_submission():
 def task_read_unfccc_crf_submission():
@@ -245,6 +247,29 @@ def task_read_new_unfccc_crf_for_year():
         'setup': ['setup_venv'],
         'setup': ['setup_venv'],
     }
     }
 
 
+
+def task_test_read_unfccc_crf_for_year():
+    """ Read CRF submission for all countries for given submission year. by default only reads
+    data not present yet. Only reads the latest updated submission for each country."""
+    actions = [f"./venv/bin/python "
+               f"UNFCCC_GHG_data/UNFCCC_CRF_reader"
+               f"/test_read_UNFCCC_CRF_for_year.py "
+               f"--submission_year={read_config_crf['submission_year']} "
+               ]
+    if read_config_crf["totest"] == "True":
+        actions[0] = actions[0] + " --totest"
+
+    if read_config_crf["data_year"] is not None:
+        actions[0] = actions[0] + f"--data_year={read_config_crf['data_year']} "
+    return {
+        #'basename': "Read_CRF_year",
+        'actions': actions,
+        'task_dep': ['set_env'],
+        'verbosity': 2,
+        'setup': ['setup_venv'],
+    }
+
+
 def task_compile_raw_unfccc_crf_for_year():
 def task_compile_raw_unfccc_crf_for_year():
     """ Read CRF submission for all countries for given submission year. by default only reads
     """ Read CRF submission for all countries for given submission year. by default only reads
     data not present yet. Only reads the latest updated submission for each country."""
     data not present yet. Only reads the latest updated submission for each country."""