From 3cab4b733d1d74e586a0cfb1dc864c2cef385761 Mon Sep 17 00:00:00 2001 From: Marcel Mueller Date: Tue, 28 Jan 2025 18:30:17 +0100 Subject: [PATCH 1/2] add check for non-convergence Signed-off-by: Marcel Mueller --- src/mindlessgen/qm/tm.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mindlessgen/qm/tm.py b/src/mindlessgen/qm/tm.py index 3ab919d..616dd38 100644 --- a/src/mindlessgen/qm/tm.py +++ b/src/mindlessgen/qm/tm.py @@ -157,7 +157,10 @@ def _run(self, temp_path: Path, arguments: list[str]) -> tuple[str, str, int]: tm_log_out = tm_out.stdout.decode("utf8", errors="replace") tm_log_err = tm_out.stderr.decode("utf8", errors="replace") - if "ridft : all done" not in tm_log_out: + if ( + "ridft : all done" not in tm_log_out + or "ridft did not converge!" in tm_log_out + ): raise sp.CalledProcessError( 1, str(self.ridft_path), @@ -207,6 +210,7 @@ def _run_opt(self, temp_path: Path, arguments: list[str]) -> tuple[str, str, int ) return tm_log_out, tm_log_err, 0 except sp.CalledProcessError as e: + print(f"subprocess error: {e}") if output_file.exists(): with open(output_file, encoding="utf-8") as file: tm_log_out = file.read() From 7aa51e3de35a7d4ce57f53c74aebc2c86a4ab325 Mon Sep 17 00:00:00 2001 From: Marcel Mueller Date: Tue, 28 Jan 2025 18:33:22 +0100 Subject: [PATCH 2/2] remove print statement Signed-off-by: Marcel Mueller --- src/mindlessgen/qm/tm.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mindlessgen/qm/tm.py b/src/mindlessgen/qm/tm.py index 616dd38..1579602 100644 --- a/src/mindlessgen/qm/tm.py +++ b/src/mindlessgen/qm/tm.py @@ -210,7 +210,6 @@ def _run_opt(self, temp_path: Path, arguments: list[str]) -> tuple[str, str, int ) return tm_log_out, tm_log_err, 0 except sp.CalledProcessError as e: - print(f"subprocess error: {e}") if output_file.exists(): with open(output_file, encoding="utf-8") as file: tm_log_out = file.read()