diff --git a/ews/coordinator/processor_surveys.py b/ews/coordinator/processor_surveys.py index ffc2355b2da4ad777fad38405b38d251d76a6dd7..30ab67b60bee5a2512139fe7fae2cb581fdd1933 100644 --- a/ews/coordinator/processor_surveys.py +++ b/ews/coordinator/processor_surveys.py @@ -327,8 +327,15 @@ class ProcessorSurveys(ProcessorBase): output_directory = f"{jobPath}/source_gen/{group_name}" Path(output_directory).mkdir(parents=True, exist_ok=True) + if 'SourcesConfigs' in config['Survey'] and group_name in config['Survey']['SourcesConfigs']: + logger.info(f"Running source gen for {group_name} group wih config {config['Survey']['SourcesConfigs'][group_name]}") + sources_config = config['Survey']['SourcesConfigs'][group_name] + else: + logger.info(f"Running source gen for {group_name} group wih default config {config['Survey']['SourcesConfigDefault']}") + sources_config = config['Survey']['SourcesConfigDefault'] + sources_path = run_case( - config_path = config['Survey']['SourcesConfigFilename'], + config_path = sources_config, survey_path = group_surveys_filepath, survey_format = config['Survey']['SurveyFormat'], surveyor_name_col = config['Survey']['SurveyorNameCol'], @@ -367,7 +374,7 @@ class ProcessorSurveys(ProcessorBase): Path(output_directory).mkdir(parents=True, exist_ok=True) sources_path = run_case( - config_path = config['Survey']['SourcesConfigFilename'], + config_path = config['Survey']['SourcesConfigDefault'], survey_path = processed_surveys_filepath, survey_format = config['Survey']['SurveyFormat'], surveyor_name_col = config['Survey']['SurveyorNameCol'], diff --git a/tests/test_data/test_deployment/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json b/tests/test_data/test_deployment/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json index 10881b43535e7c44f575daf58396266c248252b8..2df9315ac38efed24719b2f6b1e6523557889420 100644 --- a/tests/test_data/test_deployment/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json +++ b/tests/test_data/test_deployment/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json @@ -47,7 +47,7 @@ "SurveyFormat" : "ODK", "SurveyorNameCol" : "surveyor_infromation-surveyor_name", "SourcesRegionName" : "EastAfrica", - "SourcesConfigFilename" : "../../test_data/test_deployment/regions/EastAfrica/resources/source_gen/configs/config_EastAfrica_mapspam2017.json" + "SourcesConfigDefault" : "../../test_data/test_deployment/regions/EastAfrica/resources/source_gen/configs/config_EastAfrica_mapspam2017.json" }, "Environment" : { "ServerPathTemplate" : "/storage/sftp/metofficeupload/upload/Ethiopia/fromMO/daily_name/",