Skip to content

Commit

Permalink
Merge pull request #7 from OpenFreeEnergy/start_GromacsMDProtocol
Browse files Browse the repository at this point in the history
GromacsMDSetupUnit
  • Loading branch information
hannahbaumann authored Sep 20, 2024
2 parents e70ad85 + 4eae93e commit 3124bc1
Show file tree
Hide file tree
Showing 22 changed files with 10,938 additions and 35 deletions.
56 changes: 39 additions & 17 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: CI

on:
# GitHub has started calling new repo's first branch "main" https://github.com/github/renaming
# The cookiecutter uses the "--initial-branch" flag when it runs git-init
push:
branches:
- "main"
Expand All @@ -15,17 +13,36 @@ on:
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
- cron: "0 0 * * 0"

# This will cancel the workflow if we make another push,
# we want this so that if we make 3 commits, we only
# run our workflow on the last commit, instead of running
# it 3 times.
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

defaults:
run:
# This shell command is a safer default so if bash hits
# and error, it will stop
shell: bash -leo pipefail {0}

jobs:
test:
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
# We want every job in our matrix to run, so we don't
# want to fail fast
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: [3.9, "3.10", "3.11"]
# We don't really support windows so we don't need
# to test it
os: [macOS-latest, ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Additional info about the build
shell: bash
Expand All @@ -35,26 +52,31 @@ jobs:
ulimit -a
# More info on options: https://github.com/marketplace/actions/provision-with-micromamba
- uses: mamba-org/provision-with-micromamba@main
- name: "Setup Micromamba"
uses: mamba-org/setup-micromamba@v1
with:
environment-file: devtools/conda-envs/test_env.yaml
#environment-file: devtools/conda-envs/test_env.yaml
environment-file: environment.yml
environment-name: test
channels: conda-forge,defaults
extra-specs: |
cache-environment: true
cache-downloads: true
create-args: >-
python=${{ matrix.python-version }}
init-shell: bash

- name: Install package
# conda setup requires this special shell
shell: bash -l {0}
- name: Install gmxapi
run: |
python -m pip install . --no-deps
micromamba list
# gmxapi needs to be pointed to where gromacs lives
# we also need to tell it where to find our compilers
export CMAKE_ARGS="-Dgmxapi_ROOT=$CONDA_PREFIX -C $CONDA_PREFIX/share/cmake/gromacs/gromacs-hints.cmake -DCMAKE_CXX_COMPILER=$CXX -DCMAKE_C_COMPILER=$CC"
pip install gmxapi
- name: Install package
run: python -m pip install . --no-deps

- name: Run tests
# conda setup requires this special shell
shell: bash -l {0}
run: |
pytest -v --cov=openfe_gromacs --cov-report=xml --color=yes openfe_gromacs/tests/
pytest -n logical -v --cov=openfe_gromacs --cov-report=xml --color=yes openfe_gromacs/tests/
- name: CodeCov
uses: codecov/codecov-action@v3
Expand Down
22 changes: 16 additions & 6 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
name: test
channels:

- jaimergp/label/unsupported-cudatoolkit-shim
- conda-forge

- defaults
dependencies:
# Base depends
- python
- pip

- openff-toolkit-base >=0.16
- openff-units
- openff-models
- ambertools =23
# Testing
- pytest
- pytest-xdist
- pytest-cov
- pydantic >1
- codecov

# Pip-only installs
#- pip:
# - codecov
- numpy
- networkx
- rdkit
- openfe>=1.0.0rc0
- click
- openmm
- openmmtools
- plugcli
- gufe
11 changes: 11 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: test
channels:
- conda-forge
dependencies:
- openfe
- compilers
- mpi4py
- gromacs
- pytest
- pytest-xdist
- pytest-cov
26 changes: 21 additions & 5 deletions openfe_gromacs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
"""Gromacs-based protocols for Open Free Energy"""

# Add imports here
from ._version import __version__ # noqa: F401
from .openfe_gromacs import * # noqa: F401,F403
from gufe import (
AlchemicalNetwork,
ChemicalSystem,
Component,
LigandAtomMapping,
NonTransformation,
ProteinComponent,
SmallMoleculeComponent,
SolventComponent,
Transformation,
)
from gufe.protocols import (
Protocol,
ProtocolDAG,
ProtocolDAGResult,
ProtocolResult,
ProtocolUnit,
ProtocolUnitFailure,
ProtocolUnitResult,
execute_DAG,
)
2 changes: 2 additions & 0 deletions openfe_gromacs/protocols/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe-gromacs
20 changes: 20 additions & 0 deletions openfe_gromacs/protocols/gromacs_md/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe-gromacs
"""
Run MD simulation using OpenMM and OpenMMTools.
"""

from .md_methods import (
GromacsMDProtocol,
GromacsMDProtocolResult,
GromacsMDProtocolSettings,
GromacsMDSetupUnit,
)

__all__ = [
"GromacsMDProtocol",
"GromacsMDProtocolSettings",
"GromacsMDProtocolResult",
"GromacsMDProtocolUnit",
]
Loading

0 comments on commit 3124bc1

Please sign in to comment.