FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit d71f454b authored by Dr T. Mona's avatar Dr T. Mona
Browse files

feat: handle different source gen config files based on group name.

parent 4f29b6ce
No related branches found
No related tags found
No related merge requests found
......@@ -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'],
......
......@@ -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/",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment