Skip to content

Commit

Permalink
Merge pull request #131 from molssi-seamm/dev
Browse files Browse the repository at this point in the history
Added support for output of energy & gradients to JSON
  • Loading branch information
seamm authored May 14, 2024
2 parents aafcd9d + a409eff commit 3b8098b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
1 change: 0 additions & 1 deletion .github/workflows/BranchCI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches-ignore:
- 'main'
- 'master'

jobs:
branch-ci:
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dependencies:
- flake8
- pytest
- pytest-cov
- seamm-installer

# Documentation
- pydata-sphinx-theme
Expand Down
5 changes: 5 additions & 0 deletions mopac_step/energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 14 additions & 0 deletions mopac_step/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 3b8098b

Please sign in to comment.