From 45aabd9780fad5e808cdfffb7759d512375b3e76 Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Mon, 5 Jun 2023 12:03:21 -0400 Subject: [PATCH] Fixing problems parsing AUX file due to bug in MOPAC. --- HISTORY.rst | 5 +++++ mopac_step/mopac.py | 2 +- mopac_step/mopac_base.py | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 619e5d9..4898466 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,11 @@ ======= History ======= +2023.6.5 -- Bugfix working around MOPAC problem + * MOPAC is not consistent about putting end of file and end of program markers in the + AUX file. This caused carashed in SEAMM, which this fixes until MOPAC can be + corrected. + 2023.4.24 -- Bugfixes for Lewis structure * Correctly handle periodic systems in Lewis structure. * Fixed and issue with the Lewis structure GUI not displaying all the widgets. diff --git a/mopac_step/mopac.py b/mopac_step/mopac.py index 03be1a0..44e2ed5 100644 --- a/mopac_step/mopac.py +++ b/mopac_step/mopac.py @@ -317,7 +317,7 @@ def analyze(self, indent="", lines=[], n_calculations=None): lineno = 0 section = 0 for line in lines_aux: - if "END OF MOPAC FILE" in line: + if "END OF MOPAC FILE" in line or "END OF MOPAC PROGRAM" in line: self.logger.debug("\nAUX file section {}".format(section)) self.logger.debug("------------------") diff --git a/mopac_step/mopac_base.py b/mopac_step/mopac_base.py index b8487bb..4508bfc 100644 --- a/mopac_step/mopac_base.py +++ b/mopac_step/mopac_base.py @@ -192,6 +192,8 @@ def parse_aux(self, lines): line = lines[lineno].strip() if "END OF MOPAC PROGRAM" in line: continue + if "END OF MOPAC FILE" in line: + continue if line[0] == "#": continue if "=" not in line: