Skip to content

Commit

Permalink
Merge branch 'main' into fix/dataset-split
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanqing-wang authored Jul 14, 2023
2 parents 821c5f2 + aed2898 commit 74ae92a
Show file tree
Hide file tree
Showing 18 changed files with 225 additions and 156 deletions.
77 changes: 31 additions & 46 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,50 @@ name: CI
on:
pull_request:
branches:
- master
- main
push:
branches:
- master
- main

schedule:
# Nightly tests run on master by default:
# 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: "0 0 * * *"

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

defaults:
run:
shell: bash -l {0}

jobs:
test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
include:
- name: Linux, Python 3.8
os: ubuntu-latest
python-version: "3.8"
conda-installer: https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh

- name: Linux, Python 3.9
os: ubuntu-latest
python-version: "3.9"
conda-installer: https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh

- name: MacOS, Python 3.9
os: macOS-latest
python-version: "3.9"
conda-installer: https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-MacOSX-x86_64.sh
os: ['macos', 'ubuntu']
python-version:
- "3.9"
- "3.10"

env:
OPENMM: ${{ matrix.cfg.openmm }}
OE_LICENSE: ${{ github.workspace }}/oe_license.txt

steps:
- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v1
with:
installer-url: ${{ matrix.conda-installer }}
python-version: ${{ matrix.python-version }}
activate-environment: test
channel-priority: true
environment-file: devtools/conda-envs/espaloma.yaml
auto-activate-base: false
use-mamba: true
cache-environment: true
cache-downloads: true
create-args: >-
python=${{ matrix.python-version }}
- name: Additional info about the build
shell: bash
Expand All @@ -63,35 +56,27 @@ jobs:
ulimit -a
- name: Environment Information
shell: bash -l {0}
run: |
conda info --all
conda list
mamba --version
- name: Decrypt and check OE license
shell: bash -l {0}
env:
OE_LICENSE_TEXT: ${{ secrets.OE_LICENSE }}
run: |
echo "${OE_LICENSE_TEXT}" > ${OE_LICENSE}
python -c "import openeye; assert openeye.OEChemIsLicensed()"
micromamba info
micromamba list
micromamba --version
- name: Install package
shell: bash -l {0}
run: |
python -m pip install --no-deps .
python -m pip install --no-deps -e .
- name: Run tests
shell: bash -l {0}
run: |
pytest -v --cov=espaloma --cov-report=xml --color=yes espaloma/
pytest -v -n auto --cov=espaloma --cov-report=xml --color=yes espaloma/
- name: CodeCov
uses: codecov/codecov-action@v1
if: always()
uses: codecov/codecov-action@v3
if: ${{ github.repository == 'choderalab/espaloma'
&& github.event_name == 'pull_request' }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
yml: ./.codecov.yml
fail_ci_if_error: False
verbose: True
34 changes: 34 additions & 0 deletions .github/workflows/clean_cache.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# from https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries
name: cleanup caches by a branch
on:
pull_request:
types:
- closed

jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 0 additions & 33 deletions .github/workflows/sphinx.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2

build:
os: "ubuntu-20.04"
tools:
python: "mambaforge-4.10"

sphinx:
configuration: docs/conf.py
fail_on_warning: false

conda:
environment: devtools/conda-envs/espaloma.yaml

python:
# Install our python package before building the docs
install:
- method: pip
path: .
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
espaloma: **E**xtensible **S**urrogate **P**otenti**al** **O**ptimized by **M**essage-passing **A**lgorithms 🍹
==============================
[//]: # (Badges)
[![CI](https://github.com/choderalab/espaloma/actions/workflows/CI.yaml/badge.svg?branch=master)](https://github.com/choderalab/espaloma/actions/workflows/CI.yaml)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/choderalab/espaloma.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/choderalab/espaloma/alerts/)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/choderalab/espaloma.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/choderalab/espaloma/context:python)
[![docs stable](https://img.shields.io/badge/docs-stable-5077AB.svg?logo=read%20the%20docs)](https://espaloma.wangyq.net/)

[![CI](https://github.com/choderalab/espaloma/actions/workflows/CI.yaml/badge.svg?branch=main)](https://github.com/choderalab/espaloma/actions/workflows/CI.yaml)
[![Documentation Status](https://readthedocs.org/projects/espaloma/badge/?version=latest)](https://espaloma.readthedocs.io/en/latest/?badge=latest)

Source code for [Wang Y, Fass J, and Chodera JD "End-to-End Differentiable Construction of Molecular Mechanics Force Fields."](https://arxiv.org/abs/2010.01196)

![abstract](docs/_static/espaloma_abstract_v2-2.png)

#
Documentation: https://espaloma.wangyq.net/
Documentation: https://docs.espaloma.org

# Paper Abstract
Molecular mechanics (MM) potentials have long been a workhorse of computational chemistry.
Expand Down
10 changes: 5 additions & 5 deletions devtools/conda-envs/espaloma.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: test
name: espaloma-test
channels:
- conda-forge
- dglteam
- openeye
- defaults
- anaconda
dependencies:
# Base dependencies
- python
Expand All @@ -14,7 +12,7 @@ dependencies:
- numpy
- matplotlib
- scipy
- openff-toolkit <0.11
- openff-toolkit >=0.12
- openff-forcefields
- openff-units
- smirnoff99Frosst
Expand All @@ -23,10 +21,12 @@ dependencies:
- tqdm
# Pytorch
- pytorch>=1.8.0
- dgl
- dgl =0.9.0
# Testing
- pytest
- pytest-cov
- pytest-xdist
- pytest-randomly
- codecov
- nose
- nose-timer
Expand Down
11 changes: 2 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,10 @@
# Incase the project was not installed
import os
import sys
import subprocess

sys.path.insert(0, os.path.abspath('..'))

import espaloma
from espaloma import mm, nn, graphs, data

# download experiments
import os
os.system("bash download_experiments.sh")

# -- Project information -----------------------------------------------------

project = 'espaloma'
Expand All @@ -37,7 +31,6 @@
# The full version, including alpha/beta/rc tags
release = ''


# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down Expand Up @@ -81,7 +74,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
4 changes: 2 additions & 2 deletions espaloma/data/md.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ def run(self, g, in_place=True):
samples = []
for idx in range(true_n_conformers):
# put conformer in simulation
simulation.context.setPositions(g.mol.conformers[idx])
simulation.context.setPositions(g.mol.conformers[idx].to_openmm())

# set velocities
simulation.context.setVelocitiesToTemperature(self.temperature)
Expand Down Expand Up @@ -825,7 +825,7 @@ def run(self, g, in_place=True):
import random

idx = random.choice(list(range(true_n_conformers)))
simulation.context.setPositions(g.mol.conformers[idx])
simulation.context.setPositions(g.mol.conformers[idx].to_openmm())

# set velocities
simulation.context.setVelocitiesToTemperature(self.temperature)
Expand Down
Loading

0 comments on commit 74ae92a

Please sign in to comment.