From c6610b10154b8dd27ca8011f0ada77286819fdc6 Mon Sep 17 00:00:00 2001 From: jws52 <jws52@cam.ac.uk> Date: Tue, 24 Jan 2023 11:31:46 +0000 Subject: [PATCH] feat: Clearup functionality chore: Tidy imports --- coordinator/Processor.py | 8 +++----- coordinator/ProcessorComponents.py | 17 ++++++----------- tests/integration/integration_test_utils.py | 1 + 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/coordinator/Processor.py b/coordinator/Processor.py index 407dc7c..644c353 100755 --- a/coordinator/Processor.py +++ b/coordinator/Processor.py @@ -33,7 +33,6 @@ import shutil import sys # gitlab projects -# TODO: Package these projects so they are robust for importing from flagdir import jobStatus # created by jws52 # submodules of this project @@ -43,7 +42,8 @@ from ProcessorUtils import ( endScript, endJob, open_and_check_config, - PasswordODKFilter + PasswordODKFilter, + short_name ) # initialise default values for configuration @@ -60,8 +60,6 @@ script_path = os.path.dirname(__file__)+'/' coordinator_path = script_path -short_name = ProcessorComponents.short_name - # log file for all jobs log_path_project = f"{coordinator_path}logs/log.txt" @@ -233,7 +231,7 @@ def parse_and_check_args(todayString) -> dict: my_parser.add_argument( '-p', '--component', type = str, - choices = list(ProcessorComponents.short_name.keys()), + choices = list(short_name.keys()), required = True, dest = 'component', help = '''Name of EWS component to process, which must be present diff --git a/coordinator/ProcessorComponents.py b/coordinator/ProcessorComponents.py index b0a6100..7c9d85a 100644 --- a/coordinator/ProcessorComponents.py +++ b/coordinator/ProcessorComponents.py @@ -10,7 +10,11 @@ from typing import List # submodules of this project # All of the process_* functions are callable from config files for the three # coordinator stages: pre, in (during) and plotting. -from ProcessorAdvisory import process_in_job_advisory + +from ProcessorAdvisory import ( + process_in_job_advisory +) + from ProcessorDeposition import ( process_in_job_dep, process_EWS_plotting_dep @@ -38,16 +42,7 @@ from ProcessorSurveys import ( process_EWS_plotting_survey ) from ProcessorUtils import ( - open_and_check_config, - get_only_existing_globs, - subprocess_and_log, - endScript, - endJob, - add_filters_to_sublogger, - remove_path_from_tar_members, - query_past_successes, - short_name, - disease_latin_name_dict + add_filters_to_sublogger ) # TODO: Replace subprocess scp and ssh commands with paramiko.SSHClient() instance diff --git a/tests/integration/integration_test_utils.py b/tests/integration/integration_test_utils.py index bf5e5e8..1ecd042 100644 --- a/tests/integration/integration_test_utils.py +++ b/tests/integration/integration_test_utils.py @@ -92,6 +92,7 @@ class IntegrationTestUtils: args_dict['component'] = component args_dict['config_paths'] = [IntegrationTestUtils.TEMP_CONFIG_FILE_PATH] args_dict['log_level'] = 'info' + args_dict['clearup'] = False for key, value in kwargs.items(): args_dict[key] = value -- GitLab