Skip to content

Commit

Permalink
Merge pull request #13 from openforcefield/run-torsions
Browse files Browse the repository at this point in the history
Begin setting up torsion automation
  • Loading branch information
mattwthompson authored Dec 17, 2024
2 parents 1c64fc7 + b5deede commit b2cd18b
Show file tree
Hide file tree
Showing 21 changed files with 3,048 additions and 19 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
10 changes: 5 additions & 5 deletions .github/workflows/run.yaml → .github/workflows/opt.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# this is adapted from openff-docs/cookbook_preproc.yaml

name: Run benchmarks and commit the results
name: Run optimization benchmarks

on:
workflow_dispatch:
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
status: 'in_progress',
started_at: new Date().toISOString(),
output: {
title: 'Run benchmarks',
title: 'Run optimization benchmarks',
summary: 'Results and progress: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}',
text: ''
},
Expand All @@ -116,7 +116,7 @@ jobs:
with:
environment-file: ${{ inputs.env }}

- name: Run benchmarks
- name: Run optimization benchmarks
env:
LICENSE: ${{ secrets.OE_LICENSE }}
shell: bash -l {0}
Expand Down Expand Up @@ -190,7 +190,7 @@ jobs:
with:
pr_number: ${{ inputs.pr_number }}
message: >
A workflow dispatched to run benchmarks for this PR has just finished.
A workflow dispatched to run optimization benchmarks for this PR has just finished.
- Run ID: [${{ github.run_id }}]
Expand All @@ -210,7 +210,7 @@ jobs:
with:
pr_number: ${{ inputs.pr_number }}
message: >
A workflow dispatched to run benchmarks for this PR has just failed.
A workflow dispatched to run optimization benchmarks for this PR has just failed.
- Run ID: [${{ github.run_id }}]
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/run_trigger.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# this is adapted from openff-docs/cookbook_pr_trigger.yaml

name: Trigger benchmark run on comment with "/run-benchmark"
name: Trigger benchmark run

# comment on a PR with "/run-optimization-benchmark" or "/run-torsion-benchmark"

on:
issue_comment:
Expand All @@ -27,9 +29,9 @@ jobs:
// Return early if comment is not one of the trigger phrases. Otherwise
// set the type of workflow to dispatch
let benchmark_workflow;
if (comment.body.startsWith('/run-benchmark')) {
benchmark_workflow = "run.yaml"
} else if (comment.body.startsWith('/run-torsions')) {
if (comment.body.startsWith('/run-optimization-benchmarks')) {
benchmark_workflow = "opt.yaml"
} else if (comment.body.startsWith('/run-torsion-benchmarks')) {
benchmark_workflow = "torsions.yaml"
} else {
console.log("Comment is not trigger phrase")
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/torsions.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# this is adapted from openff-docs/cookbook_preproc.yaml

name: Run benchmarks and commit the results
name: Run torsion benchmarks

on:
workflow_dispatch:
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
status: 'in_progress',
started_at: new Date().toISOString(),
output: {
title: 'Run benchmarks',
title: 'Run torsion benchmarks',
summary: 'Results and progress: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}',
text: ''
},
Expand All @@ -104,6 +104,7 @@ jobs:
- name: Install git-lfs
run: |
sudo apt update
sudo apt install -y git-lfs
- uses: actions/checkout@v3
Expand All @@ -115,7 +116,7 @@ jobs:
with:
environment-file: ${{ inputs.env }}

- name: Run benchmarks
- name: Run torsion benchmarks
env:
LICENSE: ${{ secrets.OE_LICENSE }}
shell: bash -l {0}
Expand Down Expand Up @@ -145,8 +146,10 @@ jobs:
input_file=${{ inputs.path }} # path to the input YAML file
input_dir=$(dirname $input_file) # parent directory of input YAML file
git add $input_dir/output/{log_sse}.csv
git add $input_dir/output/{log_sse}.csv
git add $input_dir/output/rmsd.csv
git add $input_dir/output/een.csv
git add $input_dir/output/minimized.json
git add $input_dir/output/metrics.json
git commit -m "Add benchmark results"
git push
Expand All @@ -155,14 +158,16 @@ jobs:
- name: Upload to zenodo
env:
ZENODO_TOKEN: ${{ secrets.ZENODO_TOKEN }}
ZENODO_URL: "https://zenodo.org"
shell: bash -l {0}
run: |
# TODO: make and bundle plot(s)
bzip2 tmp.sqlite
bzip2 torsions-dev.sqlite
micromamba env export > env.yaml
input_files=$(python get_files.py ${{ inputs.path }})
python zenodo_upload.py --title "YDS Upload ${{ inputs.pr_number }}" \
tmp.sqlite.bz2 $input_dir/output/{log_sse}.csv \
torsions-dev.sqlite.bz2 $input_dir/output/rmsd.csv \
torsions-dev.sqlite.bz2 $input_dir/output/een.csv \
env.yaml torsions.py $input_files
- name: Report status to PR
Expand All @@ -172,7 +177,7 @@ jobs:
with:
pr_number: ${{ inputs.pr_number }}
message: >
A workflow dispatched to run benchmarks for this PR has just finished.
A workflow dispatched to run torsion benchmarks for this PR has just finished.
- Run ID: [${{ github.run_id }}]
Expand All @@ -192,7 +197,7 @@ jobs:
with:
pr_number: ${{ inputs.pr_number }}
message: >
A workflow dispatched to run benchmarks for this PR has just failed.
A workflow dispatched to run torsion benchmarks for this PR has just failed.
- Run ID: [${{ github.run_id }}]
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
oe_license.txt
/__pycache__/

# macOS
.DS_Store
3 changes: 3 additions & 0 deletions datasets/torsion-dev/larger.json
Git LFS file not shown
10 changes: 10 additions & 0 deletions datasets/torsion-dev/larger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from openff.qcsubmit.results import TorsionDriveResultCollection
from yammbs.torsion.inputs import QCArchiveTorsionDataset

dspath = "/home/brent/omsf/projects/valence-fitting/02_curate-data/datasets/combined-td.json"
td = TorsionDriveResultCollection.parse_file(dspath)

ytd = QCArchiveTorsionDataset.from_qcsubmit_collection(td)

with open("larger.json", "w") as out:
out.write(ytd.model_dump_json())
3 changes: 3 additions & 0 deletions datasets/torsion-dev/torsiondrive-data.json
Git LFS file not shown
2 changes: 1 addition & 1 deletion devtools/env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ dependencies:
- tqdm

- pip:
- git+https://github.com/openforcefield/yammbs.git@0.1.1
- git+https://github.com/openforcefield/yammbs.git@add-torsion-models
25 changes: 25 additions & 0 deletions devtools/torsions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: yammbs-dataset-submission

channels:
- conda-forge
- openeye

dependencies:
- python
- pip

- qcportal ~=0.55
- openff-qcsubmit >=0.52
- openff-toolkit
- openeye-toolkits
- geometric =1

- click
- matplotlib
- numpy
- pandas
- seaborn
- tqdm

- pip:
- git+https://github.com/openforcefield/yammbs.git@add-torsion-models
Loading

0 comments on commit b2cd18b

Please sign in to comment.