Quellcode durchsuchen

modify dodo.py for annexI downloading

Johannes Gütschow vor 2 Jahren
Ursprung
Commit
7eff15a27a
2 geänderte Dateien mit 10 neuen und 7 gelöschten Zeilen
  1. 1 1
      code/UNFCCC_downloader/download_annexI.py
  2. 9 6
      dodo.py

+ 1 - 1
code/UNFCCC_downloader/download_annexI.py

@@ -128,7 +128,7 @@ for idx, submission in items.iterrows():
         while not local_filename.exists() and i < 10:
             # for i = 0 and i = 5 try to get a new session ID
             if i == 1 or i == 5:
-                driver = webdriver.Firefox(options=options)
+                driver = Firefox(options=options)
     
                 # visit the main data page once to create cookies
                 driver.get(url)

+ 9 - 6
dodo.py

@@ -97,10 +97,11 @@ update_aI_config = {
 
 
 def task_update_annexi():
-    """ Update list of annexI submissions """
+    """ Update list of AnnexI submissions """
     return {
         'targets': [f"downloaded_data/UNFCCC/submissions-annexI_{update_aI_config['year']}.csv"],
-        'actions': [f"datalad run -m 'Fetch AnnexI submissions for {update_aI_config['year']}'"
+        'actions': [f"datalad run -m 'Fetch AnnexI submissions for {update_aI_config['year']}' "
+                    "--explicit "
                     f"-o downloaded_data/UNFCCC/submissions-annexI_{update_aI_config['year']}.csv "
                     f"./venv/bin/python code/UNFCCC_downloader/fetch_submissions_annexI.py "
                     f"--year={update_aI_config['year']}"],
@@ -110,14 +111,16 @@ def task_update_annexi():
 
 
 def task_download_annexi():
-    """ Download NC submissions """
+    """ Download AnnexI submissions """
     return {
         #'file_dep': ['downloaded_data/UNFCCC/submissions-nc.csv'],
         # deactivate file_dep fow now as it will always run fetch submissions
         # before download
-        'actions': ['datalad run -m "Download NC submissions" '
-                    '-i downloaded_data/UNFCCC/submissions-nc.csv '
-                    './venv/bin/python code/UNFCCC_downloader/download_non-annexI.py --category=NC'],
+        'actions': [f"datalad run -m 'Download AnnexI submissions for "
+                    f"{update_aI_config['category']}{update_aI_config['year']}'"
+                    f"-i downloaded_data/UNFCCC/submissions-annexI_{update_aI_config['year']}.csv "
+                    f"./venv/bin/python code/UNFCCC_downloader/download_annexI.py "
+                    f"--category={update_aI_config['category']} --year={update_aI_config['year']}"],
         'verbosity': 2,
         'setup': ['setup_venv'],
     }