From f60d87b8d1276100bc7840ccbb5f7a6b90b9f99f Mon Sep 17 00:00:00 2001 From: Gregor Olenik Date: Fri, 16 Feb 2024 09:52:30 +0100 Subject: [PATCH] fix typo --- src/obr/signac_wrapper/operations.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/obr/signac_wrapper/operations.py b/src/obr/signac_wrapper/operations.py index 5faba66f..c3656e33 100644 --- a/src/obr/signac_wrapper/operations.py +++ b/src/obr/signac_wrapper/operations.py @@ -213,7 +213,7 @@ def _link_path(base: Path, dst: Path, parent_id: str, copy_instead_link: bool): def needs_initialization(job: Job) -> bool: - """Check if this job has been initialized already, whithout performing the initialization""" + """Check if this job has been initialized already, without performing the initialization""" if parent_id := job.sp().get("parent_id"): if job.doc["state"].get("is_initialized"): return False @@ -230,7 +230,7 @@ def initialize_if_required(job: Job) -> bool: if job.doc["state"].get("is_initialized"): return True global GLOBAL_INIT_COUNT - GLOBAL_UNINIT_COUNT = int(os.environ.get("GLOBAL_UNINIT_COUNT", 0)) + GLOBAL_UNINIT_COUNT = os.environ.get("GLOBAL_UNINIT_COUNT") GLOBAL_INIT_COUNT += 1 base_path = Path(job.path).parent / parent_id / "case" @@ -242,10 +242,11 @@ def initialize_if_required(job: Job) -> bool: copy_instead_link = job.sp().get("operation") == "shell" _link_path(base_path, dst_path, parent_id, copy_instead_link) job.doc["state"]["is_initialized"] = True - logging.info( - "Done initialization of case" - f" {job.id} [{GLOBAL_INIT_COUNT}/{GLOBAL_UNINIT_COUNT}]\r" - ) + if GLOBAL_UNINIT_COUNT: + logging.info( + "Done initialization of case" + f" {job.id} [{GLOBAL_INIT_COUNT}/{int(GLOBAL_UNINIT_COUNT)}]\r" + ) return True else: return False