From 56533a3c7b9b520a526de3fe9b6f776eb02fa1d5 Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Tue, 14 May 2024 16:20:27 -0400 Subject: [PATCH 1/2] Added support for output of energy & gradients to JSON --- HISTORY.rst | 3 +++ mopac_step/energy.py | 5 +++++ mopac_step/metadata.py | 14 ++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index ecaf826..09164db 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,9 @@ ======= History ======= +2024.5.14 -- Added output of energy & gradients to JSON + * To support the Energy Scan step. + 2024.3.17 -- Updated installation * Updated the installation to reflect the new way to install SEAMM plug-ins to support both Conda and Docker diff --git a/mopac_step/energy.py b/mopac_step/energy.py index 1a79aa2..e1e0e2e 100644 --- a/mopac_step/energy.py +++ b/mopac_step/energy.py @@ -1044,6 +1044,11 @@ def analyze(self, indent="", data_sections=[], out_sections=[], table=None): printer.normal(str(__(text, **data, indent=4 * " "))) # Put any requested results into variables or tables + if "HEAT_OF_FORMATION" in data: + data["energy"] = data["HEAT_OF_FORMATION"] + if "GRADIENTS" in data: + tmp = np.array(data["GRADIENTS"]) + data["gradients"] = tmp.reshape(-1, 3).tolist() self.store_results( configuration=configuration, data=data, diff --git a/mopac_step/metadata.py b/mopac_step/metadata.py index 2d21d86..ee3fc67 100644 --- a/mopac_step/metadata.py +++ b/mopac_step/metadata.py @@ -1245,6 +1245,20 @@ An optional unit string for the value as returned by the code. """ metadata["results"] = { + "energy": { + "calculation": ["energy", "optimization", "thermodynamics", "vibrations"], + "description": "enthalpy of formation", + "dimensionality": "scalar", + "type": "float", + "units": "kcal/mol", + }, + "gradients": { + "calculation": ["energy", "optimization", "thermodynamics", "vibrations"], + "description": "gradients on the atoms", + "dimensionality": [3, "n_atoms"], + "type": "float", + "units": "kcal/mol/Å", + }, "ERROR_MESSAGE": { "description": "An error message", "dimensionality": "scalar", From a409eff09a7cdb2d73a369d3bdb1671bcc29ffb2 Mon Sep 17 00:00:00 2001 From: Paul Saxe Date: Tue, 14 May 2024 16:28:59 -0400 Subject: [PATCH 2/2] Updating CI configuration --- .github/workflows/BranchCI.yaml | 1 - .github/workflows/CI.yaml | 6 +----- devtools/conda-envs/test_env.yaml | 1 + 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/BranchCI.yaml b/.github/workflows/BranchCI.yaml index 55fa6f9..48c4467 100644 --- a/.github/workflows/BranchCI.yaml +++ b/.github/workflows/BranchCI.yaml @@ -4,7 +4,6 @@ on: push: branches-ignore: - 'main' - - 'master' jobs: branch-ci: diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 3d425a5..32f7673 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -7,11 +7,7 @@ on: pull_request: branches: - "main" - schedule: - # Run on master by default Sunday morning at 3:30: - # Scheduled workflows run on the latest commit on the default or base branch. - # (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule) - - cron: "30 3 * * 0" + workflow_dispatch: jobs: ci: diff --git a/devtools/conda-envs/test_env.yaml b/devtools/conda-envs/test_env.yaml index 83f3b33..2d64d03 100644 --- a/devtools/conda-envs/test_env.yaml +++ b/devtools/conda-envs/test_env.yaml @@ -20,6 +20,7 @@ dependencies: - flake8 - pytest - pytest-cov + - seamm-installer # Documentation - pydata-sphinx-theme