From ebfc3ab0a211868753cc79e34371f76fcea81450 Mon Sep 17 00:00:00 2001 From: Kiarash Jamali Date: Thu, 28 Sep 2023 14:09:45 +0100 Subject: [PATCH 1/3] WIP test relion pipeline-control --- model_angelo/apps/build.py | 3 ++- model_angelo/apps/build_no_seq.py | 3 ++- model_angelo/apps/hmm_search.py | 3 ++- model_angelo/apps/refine.py | 3 ++- model_angelo/utils/misc_utils.py | 4 ++-- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/model_angelo/apps/build.py b/model_angelo/apps/build.py index a5659af..7e6abca 100644 --- a/model_angelo/apps/build.py +++ b/model_angelo/apps/build.py @@ -129,7 +129,8 @@ def add_args(parser): parser.add_argument( "--pipeline-control", "--pipeline_control", - action="store_true", + type=str, + default="", help=argparse.SUPPRESS, ) diff --git a/model_angelo/apps/build_no_seq.py b/model_angelo/apps/build_no_seq.py index e55b1c5..ece968e 100644 --- a/model_angelo/apps/build_no_seq.py +++ b/model_angelo/apps/build_no_seq.py @@ -105,7 +105,8 @@ def add_args(parser): parser.add_argument( "--pipeline-control", "--pipeline_control", - action="store_true", + type=str, + default="", help=argparse.SUPPRESS, ) diff --git a/model_angelo/apps/hmm_search.py b/model_angelo/apps/hmm_search.py index 308ad7c..7a4b04d 100644 --- a/model_angelo/apps/hmm_search.py +++ b/model_angelo/apps/hmm_search.py @@ -106,7 +106,8 @@ def add_args(parser): parser.add_argument( "--pipeline-control", "--pipeline_control", - action="store_true", + type=str, + default="", help=argparse.SUPPRESS, ) diff --git a/model_angelo/apps/refine.py b/model_angelo/apps/refine.py index 0e2c34c..d4fd2b0 100644 --- a/model_angelo/apps/refine.py +++ b/model_angelo/apps/refine.py @@ -99,7 +99,8 @@ def add_args(parser): parser.add_argument( "--pipeline-control", "--pipeline_control", - action="store_true", + type=str, + default="", help=argparse.SUPPRESS, ) diff --git a/model_angelo/utils/misc_utils.py b/model_angelo/utils/misc_utils.py index 00ab8b3..2366cda 100644 --- a/model_angelo/utils/misc_utils.py +++ b/model_angelo/utils/misc_utils.py @@ -129,9 +129,9 @@ def is_relion_abort(directory: str) -> bool: def write_relion_job_exit_status( - directory: str, status: str, pipeline_control: bool = False, + directory: str, status: str, pipeline_control: str = "", ): - if pipeline_control: + if pipeline_control != "": open(os.path.join(directory, f"RELION_JOB_EXIT_{status}"), "a").close() elif status == "FAILURE": sys.exit(1) From 9f6a688564c8d3fca778ede8a0b0900f5e2fa422 Mon Sep 17 00:00:00 2001 From: Kiarash Jamali Date: Thu, 28 Sep 2023 14:25:14 +0100 Subject: [PATCH 2/3] Errors should propagate to stderr --- model_angelo/utils/misc_utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/model_angelo/utils/misc_utils.py b/model_angelo/utils/misc_utils.py index 2366cda..694fcfd 100644 --- a/model_angelo/utils/misc_utils.py +++ b/model_angelo/utils/misc_utils.py @@ -71,6 +71,14 @@ def setup_logger(log_path: str): enqueue=True, diagnose=True, ) + logger.add( + sys.stderr, + format="{time:YYYY-MM-DD at HH:mm:ss} | {level} | {message}", + enqueue=True, + level="ERROR", + backtrace=False, + diagnose=False, + ) return logger From 7c2d69fa3139bd0041ee8471b76e611ed9078a7f Mon Sep 17 00:00:00 2001 From: Kiarash Jamali Date: Thu, 28 Sep 2023 14:25:51 +0100 Subject: [PATCH 3/3] Bump version --- model_angelo/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model_angelo/__init__.py b/model_angelo/__init__.py index 1dd50dd..5617bc1 100644 --- a/model_angelo/__init__.py +++ b/model_angelo/__init__.py @@ -5,4 +5,4 @@ """ -__version__ = "1.0.3" +__version__ = "1.0.4"