From 63fba6b260917db5588ae9b9c35a328e66906787 Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Thu, 20 Oct 2022 17:53:42 -0400 Subject: [PATCH 1/2] Added property handling. --- read_structure_step/formats/mop/obabel.py | 39 ++++++++++++----------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/read_structure_step/formats/mop/obabel.py b/read_structure_step/formats/mop/obabel.py index 7a98e39..266c48c 100644 --- a/read_structure_step/formats/mop/obabel.py +++ b/read_structure_step/formats/mop/obabel.py @@ -20,19 +20,19 @@ logger = logging.getLogger("read_structure_step.read_structure") metadata = { - "CP": "constant pressure heat capacity", - "CPR": "reference.constant pressure heat capacity", - "D": "dipole moment", - "DR": "dipole moment.reference", - "H": "enthalpy of formation", - "HR": "enthalpy of formation.reference", - "S": "entropy", - "SR": "entropy.reference", - "I": "ionization energy", - "IE": "ionization energy", - "IA": "ionization energy", - "IR": "ionization energy.reference", - "GR": "geometry.reference", + "CP": "constant pressure heat capacity#experiment", + "CPR": "reference.constant pressure heat capacity#experiment", + "D": "dipole moment#experiment", + "DR": "dipole moment.reference#experiment", + "H": "enthalpy of formation#experiment", + "HR": "enthalpy of formation.reference#experiment", + "S": "entropy#experiment", + "SR": "entropy.reference#experiment", + "I": "ionization energy#experiment", + "IE": "ionization energy#experiment", + "IA": "ionization energy#experiment", + "IR": "ionization energy.reference#experiment", + "GR": "geometry.reference#experiment", } multiplicities = { "SINGLET": 1, @@ -495,13 +495,13 @@ def load_mop( if save_data: properties = configuration.properties if len(keywords) != 0: - key = "MOPAC.keywords" + key = "keywords#MOPAC" properties.add( key, "str", description="The keywords for MOPAC", noerror=True ) properties.put(key, " ".join(keywords)) if len(description_lines) > 0: - key = "MOPAC.description" + key = "description#MOPAC" properties.add( key, "str", @@ -510,7 +510,7 @@ def load_mop( ) properties.put(key, "\n".join(description_lines)) if energy is not None: - key = "MOPAC.reference energy" + key = "reference energy#MOPAC" properties.add( key, "float", @@ -552,13 +552,16 @@ def load_mop( tmp = value.split(",") value = tmp[0].strip() stderr = tmp[1].strip() + tmp = keyword.split("#") + tmp[0] = tmp[0] + " stderr" + new_keyword = "#".join(tmp) properties.add( - f"{keyword}.stderr", + new_keyword, "float", description=f"stderr for the {keyword}.", noerror=True, ) - properties.put(f"{keyword}.stderr", stderr) + properties.put(new_keyword, stderr) properties.put(keyword, value) except Exception as e: print(f"{e}: {key}") From d5e789564d4a25cf7427c2e874c2fd6da6b5b38c Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Thu, 20 Oct 2022 17:54:01 -0400 Subject: [PATCH 2/2] Updated for new, open source MOPAC distribution. --- read_structure_step/formats/mop/find_mopac.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/read_structure_step/formats/mop/find_mopac.py b/read_structure_step/formats/mop/find_mopac.py index 0498a67..c220dbe 100644 --- a/read_structure_step/formats/mop/find_mopac.py +++ b/read_structure_step/formats/mop/find_mopac.py @@ -26,37 +26,37 @@ def find_mopac(): # Next try common locations try: - mopac_exe = "/opt/mopac/MOPAC2016.exe" + mopac_exe = "/opt/mopac/mopac" if os.path.isfile(mopac_exe) is False: raise FileNotFoundError( 'The directory "/opt/mopac/" exists, but the executable \ - "MOPAC2016.exe" is not there' + "mopac" is not there' ) except FileNotFoundError: try: mopac_path = os.path.split(os.environ["mopac"])[0] - mopac_exe = mopac_path + "MOPAC2016.exe" + mopac_exe = mopac_path + "mopac" if os.path.isfile(mopac_exe) is False: raise FileNotFoundError( 'The environment variable "mopac" is defined, but \ - the executable "MOPAC2016.exe" is not there' + the executable "mopac" is not there' ) except (KeyError, FileNotFoundError): try: - mopac_exe = Path(os.environ["MOPAC_LICENSE"]) / "MOPAC2016.exe" + mopac_exe = Path(os.environ["MOPAC_LICENSE"]) / "mopac" mopac_exe = str(mopac_exe) if os.path.isfile(mopac_exe) is False: raise FileNotFoundError( 'The environment variable "mopac" is defined, but the \ - executable "MOPAC2016.exe" is not there' + executable "mopac" is not there' ) except (KeyError, FileNotFoundError): try: - mopac_exe = seamm_util.check_executable("MOPAC2016.exe") + mopac_exe = seamm_util.check_executable("mopac") except FileNotFoundError: return None