From 554fb02487cf94dd34ed1a004e786025913c56cb Mon Sep 17 00:00:00 2001 From: rlaplaza Date: Fri, 6 Oct 2023 13:53:51 +0200 Subject: [PATCH] More reading options --- navicat_marc/molecule.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/navicat_marc/molecule.py b/navicat_marc/molecule.py index 41d6044..6526264 100755 --- a/navicat_marc/molecule.py +++ b/navicat_marc/molecule.py @@ -497,6 +497,14 @@ def from_file(self, filename, noh=True): energy = None except AttributeError: energy = None + if "Energy:" in title and energy is None: + try: + etitle = title.split(":")[1].split(" ")[1].rstrip() + energy = float(etitle) * ha_to_kcalmol + except ValueError: + energy = None + except AttributeError: + energy = None if "Eopt" in title and energy is None: try: etitle = title.split("Eopt")[-1].rstrip() @@ -586,6 +594,14 @@ def from_lines(self, lines, noh=True): energy = None except AttributeError: energy = None + if "Energy:" in title and energy is None: + try: + etitle = title.split(":")[1].split(" ")[1].rstrip() + energy = float(etitle) * ha_to_kcalmol + except ValueError: + energy = None + except AttributeError: + energy = None if "Eopt" in title and energy is None: try: etitle = title.split("Eopt")[-1].rstrip()