From 916ad156781392ef02741d7dfd6fa89f1996dbc1 Mon Sep 17 00:00:00 2001
From: lb584 <lb584@cam.ac.uk>
Date: Thu, 20 Jun 2024 14:34:11 +0100
Subject: [PATCH] fixing met resample configs

---
 ews/coordinator/processor_base.py                          | 1 -
 ews/coordinator/utils/processor_utils.py                   | 3 ++-
 .../met_resample_config_EastAfrica_fc_live.json            | 7 +++++++
 3 files changed, 9 insertions(+), 2 deletions(-)
 create mode 100644 pipeline_resources/configs/coordinator/met_resample_config_EastAfrica_fc_live.json

diff --git a/ews/coordinator/processor_base.py b/ews/coordinator/processor_base.py
index 9fe8553..67ee6e0 100755
--- a/ews/coordinator/processor_base.py
+++ b/ews/coordinator/processor_base.py
@@ -313,7 +313,6 @@ class ProcessorBase:
                 configjson['StartString'] = start_date
 
                 # from configtemplate create configFileName to describe the specific job
-                component: str = component
                 config_file_name = f"{os.path.basename(configtemplate).replace('.json', '')}_{component}"
 
                 configjson['ConfigFilePath'] = config_file_name
diff --git a/ews/coordinator/utils/processor_utils.py b/ews/coordinator/utils/processor_utils.py
index 6bffe56..a8792ab 100644
--- a/ews/coordinator/utils/processor_utils.py
+++ b/ews/coordinator/utils/processor_utils.py
@@ -141,7 +141,8 @@ def parse_json_file_with_tokens(file_path: str, tokens: dict = None) -> dict:
         if "${" in parsed_file_string:
             logger.warning(f"\n\nUNRESOLVED TOKENS IN THE CONFIG FILE: {file_path} - THIS MAY BE BECAUSE YOU ARE DECLARING "
                            f"VALUES WHICH INCLUDE A TOKEN, WHERE THE VALUE OF THE TOKEN ITSSELF USES A TOKEN. YOU CAN "
-                           f"NOT DECLARE TOKENS WHICH DEPEND ON OTHER TOKENS\n\n")
+                           f"NOT DECLARE TOKENS WHICH DEPEND ON OTHER TOKENS\n\nNOTE THIS MAY NOT BE A PROBLEM, AS SOME "
+                           f"PIPELINES USE OTHER TOKENS WHICH ARE PARSED ELSEWHERE IN THE CODE\n\n")
             logger.warning(f"UNRESOLVED TOKENS: {parsed_file_string}")
         # finally, parse the tokenized string as a json dict
         result = json.loads(parsed_file_string)
diff --git a/pipeline_resources/configs/coordinator/met_resample_config_EastAfrica_fc_live.json b/pipeline_resources/configs/coordinator/met_resample_config_EastAfrica_fc_live.json
new file mode 100644
index 0000000..0a91379
--- /dev/null
+++ b/pipeline_resources/configs/coordinator/met_resample_config_EastAfrica_fc_live.json
@@ -0,0 +1,7 @@
+{
+    "RunConfig" : "${ConfigsPath}/met_resample/run_config_MetResample.json",
+    "Environment" : {
+            "SuccessFileTemplate" : "${WorkspacePath}/ENVIRONMENT_2.0_${StartString}/STATUS_SUCCESS"
+    },
+    "CalculationSpanDays" : [0,5]
+}
\ No newline at end of file
-- 
GitLab