From b3139a67af47b0c14ec2c6ee67d40f98cb9b7542 Mon Sep 17 00:00:00 2001 From: lb584 <lb584@cam.ac.uk> Date: Thu, 29 Aug 2024 15:44:37 +0100 Subject: [PATCH] dropping the return of plotting outputs as not needed now we use workflow manager --- ews/coordinator/processor_epidemiology.py | 31 +++-------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/ews/coordinator/processor_epidemiology.py b/ews/coordinator/processor_epidemiology.py index 0a2aa23..15cf9c8 100644 --- a/ews/coordinator/processor_epidemiology.py +++ b/ews/coordinator/processor_epidemiology.py @@ -553,26 +553,6 @@ class ProcessorEpidemiology(ProcessorBase): logger.debug('Saving tif output as png for easier viewing') plotRaster.save_raster_as_png(outfile) - # comparison figure - - # TODO: make this plot configurable? with function or args? - #logger.info('Plotting epi output alongside contributing components') - # figure_func = getattr(EpiAnalysis,'plot_compare_host_env_dep_infection') - logger.info('Plotting composite image of epi formulations') - figure_func = getattr(EpiAnalysis, 'plot_compare_epi_cases') - - # isolate the config for this function, in case of modifications - config_epi_for_comparison = config.copy() - - fig,axes,cases = figure_func( - config_epi_for_comparison, - start_str = start_string, - end_str = end_string) - - SaveFileName = f"{case_specific_path}/EPI_{config_filename}_comparison" - - fig.savefig(SaveFileName+'.png',dpi=300) - # slice the epi results into before forecast and in forecast for epiconf in config['Epi']: @@ -633,8 +613,8 @@ class ProcessorEpidemiology(ProcessorBase): return proc_out - def process_EWS_plotting_epi(self, jobPath,config) -> [str]: - '''Returns a list of output files for transfer.''' + + def process_EWS_plotting_epi(self, job_path, config): logger.info('started process_EWS_plotting_epi()') @@ -676,7 +656,7 @@ class ProcessorEpidemiology(ProcessorBase): # TODO: handle multiple diseases and regions in Processor as a loop, or in the config deposition_disease_name = [disease_latin_name_dict[disease]+'_DEPOSITION' for disease in diseases][0] - ews_plot_dir = f"{jobPath}/plotting/" + ews_plot_dir = f"{job_path}/plotting/" Path(ews_plot_dir).mkdir(parents=True, exist_ok=True) @@ -758,11 +738,6 @@ class ProcessorEpidemiology(ProcessorBase): logger.error('EWS-Plotting did not produce any output') raise RuntimeError - # provide to list for transfer - ews_plotting_outputs: [str] = [item for ews_plotting_output in ews_plotting_output_globs for item in glob(ews_plotting_output)] - - return ews_plotting_outputs - if __name__ == '__main__': processor = ProcessorEpidemiology() -- GitLab