Skip to content

Commit

Permalink
Atomate2 OpenMM integration & broader classical MD framework (materia…
Browse files Browse the repository at this point in the history
…lsproject#782)

* Move remaining content from common.py to renamed base.py.

* Update core.py with skeleton code for openff_job and generate_interchange methods.

* Complete Calculation, CalculationInput, and CalculationOutput schemas for classical_md.openmm.tasks.py

* Implement BaseOpenMMMaker for classical_md.openmm workflow

* Update core jobs for classical_md.openmm to be compatible with new BaseOpenMMMaker

* Add MoleculeSpec to classical_md.schemas and modify OpenMMTaskDoc

* Implement attribute inheritance logic for base openmm maker and openmm jobs

* Add from/as_dict functions for openff topology, interchange, molecule, and quantity

* Fix serialization issues with conflicting pydantic versions between Interchange and atomate2

* Implement anneal and production workflows

* Update resolve_attr logic to set missing attributes

* Change ClassicalMDTaskDocument to OpenMMTaskDocument in base.py

* Store interchange intermediate as a JSON string to fix parsing issues

* Implement temperature change logic in TempChangeMaker

* Improve state reporter to append to state file

* Output taskdoc_json file to directory for easy building

* Enhance documentation for all components

* Implement micromamba for testing environment

* Change all docstrings to numpy format

* Add CodeCov for classical_md tests

* Rename "steps" argument to "n_steps" and "output_steps" to "steps" in CalculationOutput

* Add support for writing trajectory to HDF5 file

* Implement MDAReporter for trajectory output

* Add embed_traj argument to base_openmm_maker

* Add traj_blob keyword and switch interchange to type HexBytes

* Move classical_md schemas to emmet

* Implement OPLS force field support through ligpargen

* Create FauxInterchange object for OPLS compatibility

* Refactor OpenMMFlowMaker and BaseOpenMMMaker

* Add XMLMoleculeFF class for manipulating XML files representing OpenMM-compatible ForceFields

* Split utilities and jobs in jobs/opls.py into separate files

* Refactor utilities to isolate OpenFF dependency

* Add support for MACE-based interchanges

* Update OpenMM tutorial

* Support BaseOpenMMMaker returning structures

* Implement reading and writing of structure to/from OpenMMTaskDocument

---------

Co-authored-by: Alex Ganose <[email protected]>
Co-authored-by: Orion Cohen <[email protected]>
Co-authored-by: Janosh Riebesell <[email protected]>
  • Loading branch information
4 people authored and hrushikesh-s committed Nov 16, 2024
1 parent 1a80eaa commit 0258cd9
Show file tree
Hide file tree
Showing 43 changed files with 4,585 additions and 24 deletions.
51 changes: 29 additions & 22 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,51 +31,58 @@ jobs:
- 27017:27017

runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0} # enables conda/mamba env activation by reading bash profile
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
- name: Check out repo
uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up micromamba
uses: mamba-org/setup-micromamba@main

- name: Create mamba environment
run: |
micromamba create -n a2 python=${{ matrix.python-version }} --yes
- name: Install uv
run: micromamba run -n a2 pip install uv

- name: Install enumlib
- name: Install conda dependencies
run: |
cd ..
git clone --recursive https://github.com/msg-byu/enumlib.git
cd enumlib/symlib/src
export F90=gfortran
make
cd ../../src
make enum.x
sudo mv enum.x /usr/local/bin/
cd ..
sudo cp aux_src/makeStr.py /usr/local/bin/
continue-on-error: true # This is not critical to succeed.
micromamba install -n a2 -c conda-forge enumlib packmol bader openbabel openff-toolkit==0.16.2 openff-interchange==0.3.22 --yes
- name: Install dependencies
run: |
micromamba activate a2
python -m pip install --upgrade pip
mkdir -p ~/.abinit/pseudos
cp -r tests/test_data/abinit/pseudos/ONCVPSP-PBE-SR-PDv0.4 ~/.abinit/pseudos
pip install .[strict,tests,abinit]
pip install torch-runstats
pip install --no-deps nequip==0.5.6
uv pip install .[strict,tests,abinit]
uv pip install torch-runstats
uv pip install --no-deps nequip==0.5.6
- name: Install pymatgen from master if triggered by pymatgen repo dispatch
if: github.event_name == 'repository_dispatch' && github.event.action == 'pymatgen-ci-trigger'
run: pip install --upgrade 'git+https://github.com/materialsproject/pymatgen@${{ github.event.client_payload.pymatgen_ref }}'
run: |
micromamba activate a2
uv pip install --upgrade 'git+https://github.com/materialsproject/pymatgen@${{ github.event.client_payload.pymatgen_ref }}'
- name: Test Notebooks
run: pytest --nbmake ./tutorials
run: |
micromamba activate a2
pytest --nbmake ./tutorials --ignore=./tutorials/openmm_tutorial.ipynb
- name: Test
env:
MP_API_KEY: ${{ secrets.MP_API_KEY }}
run: pytest --cov=atomate2 --cov-report=xml
run: |
micromamba activate a2
pytest --cov=atomate2 --cov-report=xml
- uses: codecov/codecov-action@v1
if: matrix.python-version == '3.10' && github.repository == 'materialsproject/atomate2'
Expand Down
Loading

0 comments on commit 0258cd9

Please sign in to comment.