FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 4249ad41 authored by J.W. Smith's avatar J.W. Smith
Browse files

fix: Do not guess epi input file listers

Because of changes to EpiPrepLister in the last few months, the file listers have changed name and are too complicated to guess. Now, it will be necessary for the user to specify them in the input config file. EpiPrepLister's docstring will have to guide the user clearly enough.
parent 9c89e4c7
No related branches found
No related tags found
No related merge requests found
......@@ -210,18 +210,8 @@ def process_in_job_epi(jobPath,status,config,component):
config_epi['Deposition']['FileNamePrepared'] = f"{jobDataPath}/data_input_deposition.csv"
# Use config-defined file lister in config file instead of here
file_lister_dep_name = config_epi['Deposition'].get('FileListerFunction',None)
# when it isn't defined, guess what it should be
if file_lister_dep_name is None:
file_lister_dep_name = 'list_deposition_files_operational'
if date_diff > datetime.timedelta(days=7):
file_lister_dep_name = 'list_deposition_files_historical'
logger.info('Using historical method to prepare data on spore deposition')
# Use config-defined file lister
file_lister_dep_name = config_epi['Deposition']['FileListerFunction']
file_lister_dep = getattr(EpiPrepLister,file_lister_dep_name)
......@@ -317,24 +307,8 @@ def process_in_job_epi(jobPath,status,config,component):
config_epi['Environment']['FileNamePrepared'] = f"{jobDataPath}/data_input_environment.csv"
# Use config-defined file lister in config file instead of here
file_lister_env_name = config_epi['Environment'].get('FileListerFunction',None)
# when it isn't defined, guess what it should be
if file_lister_env_name is None:
use_monthly_chunk=False # hard-coded for historical analysis
file_lister_env_name = 'list_env_suit_files_operational'
if (date_diff > datetime.timedelta(days=7)) & ('ENVIRONMENT_2.0' in config_epi['Environment']['PathTemplate']) & use_monthly_chunk:
logger.info('Using monthly-chunk method to prepare data on environmental suitability')
file_lister_env_name = 'list_env_suit_files_historical_monthlychunk'
elif date_diff > datetime.timedelta(days=7):
logger.info('Using historical method to prepare data on environmental suitability')
file_lister_env_name = 'list_env_suit_files_historical'
# Use config-defined file lister
file_lister_env_name = config_epi['Environment']['FileListerFunction']
file_lister_env = getattr(EpiPrepLister,file_lister_env_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