Skip to content

Commit

Permalink
Merge branch 'main' into fix-methane-charging
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyminium authored Oct 22, 2024
2 parents 4e30c47 + 6aef0ed commit 4d2fcd8
Show file tree
Hide file tree
Showing 13 changed files with 336 additions and 66 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/base-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Base tests
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# weekly tests, Sundays at midnight
- cron: "0 0 * * 0"

concurrency:
# Specific group naming so CI is only cancelled
# within same PR or on merge to main
group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true

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

env:
OE_LICENSE: ${{ github.workspace }}/oe_license.txt

jobs:
main_tests:
name: CI (${{ matrix.os }}, py-${{ matrix.python-version }}, openeye=${{ matrix.include-openeye }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-13, macOS-latest, ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]
include-openeye: [false, true]

steps:
- uses: actions/checkout@v4

- name: Build information
run: |
uname -a
df -h
ulimit -a
- name: Install environment
uses: mamba-org/setup-micromamba@v2
with:
environment-file: devtools/conda-envs/base.yaml
create-args: >-
python=${{ matrix.python-version }}
- name: Install package
run: |
python -m pip install . --no-deps
- uses: ./.github/actions/include-openeye
if: matrix.include-openeye == true
with:
openeye-license-text: ${{ secrets.OE_LICENSE }}
openeye-license-file: ${{ env.OE_LICENSE }}


- name: Uninstall OpenEye
if: matrix.include-openeye == false
run: conda remove --force openeye-toolkits --yes || echo "openeye not installed"

- name: Check toolkit installations
shell: bash -l -c "python -u {0}"
run: |
from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE
assert str(OPENEYE_AVAILABLE).lower() == '${{ matrix.include-openeye }}'
assert str(RDKIT_AVAILABLE).lower() == 'true'
- name: Run tests
run: |
python -m pytest -n 4 -v --cov=openff/nagl --cov-config=setup.cfg --cov-append --cov-report=xml --color=yes openff/nagl/
68 changes: 55 additions & 13 deletions .github/workflows/dev-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ concurrency:
defaults:
run:
shell: bash -l {0}

env:
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
DGL_HOME: ${{ github.workspace }}/dgl

jobs:
nightly_check:
Expand All @@ -22,8 +26,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macOS-12, ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]
os: [macOS-13, macOS-latest, ubuntu-latest]
python-version: ["3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand All @@ -42,25 +46,63 @@ jobs:
python=${{ matrix.python-version }}
pydantic=2
- name: Install nightly pytorch-lightning and DGL
- name: Install nightly pytorch
run: |
python -m pip install --pre dgl -f https://data.dgl.ai/wheels-test/repo.html
python -m pip install --pre dglgo -f https://data.dgl.ai/wheels-test/repo.html
python -m pip install https://github.com/Lightning-AI/lightning/archive/refs/heads/master.zip -U
python -m pip install https://github.com/Lightning-AI/lightning/archive/refs/heads/master.zip -U
- name: Install package
- name: Download DGL source
run: |
python -m pip install . --no-deps
git clone --recurse-submodules https://github.com/dmlc/dgl.git
- name: Set up DGL
if: matrix.os != 'ubuntu-latest'
run: |
# from https://docs.dgl.ai/en/latest/install/index.html#macos
cd dgl/
mkdir build && cd build
cmake -DUSE_OPENMP=off -DUSE_LIBXSMM=OFF ..
make -j4
cd ../..
- name: Set up DGL (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
cd dgl/
mkdir build && cd build
cmake -DBUILD_TYPE=dev -DUSE_CUDA=OFF -DUSE_LIBXSMM=OFF ..
make
cd ../..
- name: Install DGL Python bindings
run: |
cd dgl/python
python setup.py install
python setup.py build_ext --inplace
cd ../..
- name: Python information
- uses: ./.github/actions/include-openeye
with:
openeye-license-text: ${{ secrets.OE_LICENSE }}
openeye-license-file: ${{ env.OE_LICENSE }}

- name: Check toolkit installations
shell: bash -l -c "python -u {0}"
run: |
which python
conda info
conda list
from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE
assert str(OPENEYE_AVAILABLE).lower() == 'true'
assert str(RDKIT_AVAILABLE).lower() == 'true'
- name: Check Python environment
run: |
pip list
- name: Import DGL
run: |
python -c "import dgl"
python -c "import dgl; import dgl.nn"
- name: Install package
run: |
python -m pip install . --no-deps
- name: Run tests
run: |
Expand Down
49 changes: 16 additions & 33 deletions .github/workflows/gh-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macOS-12, ubuntu-latest]
os: [macOS-13, macOS-latest, ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]
pydantic-version: ["1", "2"]
include-rdkit: [false, true]
Expand All @@ -39,12 +39,6 @@ jobs:
exclude:
- include-rdkit: false
include-openeye: false
# no openeye for 3.12 yet
- include-openeye: true
python-version: "3.12"
# no builds?
- include-dgl: true
python-version: "3.12"


steps:
Expand All @@ -57,7 +51,7 @@ jobs:
ulimit -a
- name: Install environment
uses: mamba-org/setup-micromamba@v1
uses: mamba-org/setup-micromamba@v2
with:
environment-file: devtools/conda-envs/test_env_dgl_${{ matrix.include-dgl }}.yaml
create-args: >-
Expand All @@ -77,11 +71,11 @@ jobs:

- name: Uninstall OpenEye
if: matrix.include-openeye == false
run: conda remove --force openeye-toolkits --yes || echo "openeye not installed"
run: micromamba remove --force openeye-toolkits --yes || echo "openeye not installed"

- name: Uninstall RDKit
if: matrix.include-rdkit == false
run: conda remove --force rdkit --yes || echo "rdkit not installed"
run: micromamba remove --force rdkit --yes || echo "rdkit not installed"

# See https://github.com/openforcefield/openff-nagl/issues/103
- name: Rewrite DGL config
Expand All @@ -90,22 +84,21 @@ jobs:
mkdir -p ~/.dgl
echo '{"backend": "pytorch"}' > ~/.dgl/config.json
- name: Python information
run: |
which python
conda info
conda list
- name: Check toolkit installations
shell: bash -l -c "python -u {0}"
run: |
from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE
assert str(OPENEYE_AVAILABLE).lower() == '${{ matrix.include-openeye }}'
assert str(RDKIT_AVAILABLE).lower() == '${{ matrix.include-rdkit }}'
- name: Check DGL installation
if: matrix.include-dgl == true
run: |
python -c "import dgl"
- name: Run tests
run: |
python -m pytest -n 4 -v --cov=openff/nagl --cov-config=setup.cfg --cov-append --cov-report=xml --color=yes openff/nagl/
python -m pytest -v --cov=openff/nagl --cov-config=setup.cfg --cov-append --cov-report=xml --color=yes openff/nagl/
- name: codecov
uses: codecov/codecov-action@v4
Expand Down Expand Up @@ -177,29 +170,19 @@ jobs:
- uses: actions/checkout@v4

- name: Install conda
uses: conda-incubator/setup-miniconda@v3
uses: mamba-org/setup-micromamba@v2
with:
python-version: ${{ matrix.python-version }}
add-pip-as-python-dependency: true
architecture: x64
miniforge-variant: Mambaforge
use-mamba: true
auto-update-conda: true
show-channel-urls: true
channels: conda-forge, defaults
environment-name: openff-nagl
create-args: >-
python=${{ matrix.python-version }}
- name: Build from source
run: |
conda create --name openff-nagl
conda activate openff-nagl
conda list
mamba env update --name openff-nagl --file devtools/conda-envs/docs_env.yaml
micromamba env update --name openff-nagl --file devtools/conda-envs/docs_env.yaml
python --version
python -m pip install . --no-deps
conda list
micromamba list
- name: Check success
run: |
conda activate openff-nagl
python -c "import openff.nagl ; print(openff.nagl.__version__)"
35 changes: 35 additions & 0 deletions devtools/conda-envs/base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: openff-nagl-test
channels:
- conda-forge
- defaults
dependencies:
# Base depends
- python
- pip
- importlib_resources

# UI
- click
- click-option-group
- rich
- tqdm

# chemistry
- openff-toolkit-base >=0.11.1
- openff-units
- pydantic <3
- rdkit
- scipy

# files
- pyyaml

# gcn
- pytorch >=2.0
- pytorch-lightning

# Testing
- pytest
- pytest-cov
- pytest-xdist
- codecov
16 changes: 12 additions & 4 deletions devtools/conda-envs/nightly.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: openff-nagl-test
channels:
- openeye
- pytorch-nightly
- conda-forge
- pytorch-nightly
- defaults
dependencies:
# Base depends
Expand All @@ -18,13 +18,16 @@ dependencies:
- pydantic <3
- rdkit
- scipy
- openeye-toolkits

# gnn
- pytorch
- torchvision
- torchaudio

# database
- pyarrow

# gcn
- pytorch

# parallelism
- dask-jobqueue

Expand All @@ -49,6 +52,11 @@ dependencies:
- sqlite
- xmltodict

# building
- make
- cmake
- cython

# Pip-only installs
- pip:
- git+https://github.com/openforcefield/openff-utilities.git@main
Expand Down
1 change: 0 additions & 1 deletion devtools/conda-envs/test_env_dgl_false.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: openff-nagl-test
channels:
- openeye
- conda-forge
- defaults
dependencies:
# Base depends
- python
Expand Down
2 changes: 0 additions & 2 deletions devtools/conda-envs/test_env_dgl_true.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: openff-nagl-test
channels:
- openeye
- dglteam
- conda-forge
- defaults
dependencies:
# Base depends
- python
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The rules for this file:
- Removed unused, undocumented code paths, and updated docs (PR #132)

### Fixed
- Fixed molecule normalization issues (Issue #119, PR #149)
- Check lookup tables for allowed molecules before ChemicalDomain for forbidden ones (PR #145, Issue #144)
- Add support for single atoms (PR #146, Issue #138)

Expand Down
Loading

0 comments on commit 4d2fcd8

Please sign in to comment.