Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
4928416
environment talktorial t002
PaulaKramer Jan 26, 2024
aea9bc0
environment t003
PaulaKramer Jan 26, 2024
3a2f604
Env and minor fixes in notebook
Jan 26, 2024
7272679
Merge remote-tracking branch 'origin/sepenv-t001' into sepenv
mbackenkoehler Jan 29, 2024
e1bddd3
Merge remote-tracking branch 'origin/sepenv-t002' into sepenv
mbackenkoehler Jan 29, 2024
1380c1d
Merge remote-tracking branch 'origin/sepenv-t003' into sepenv
mbackenkoehler Jan 29, 2024
f8d0640
initial CI re-design for separate envs
mbackenkoehler Jan 29, 2024
a963f26
no Mambaforge
mbackenkoehler Jan 29, 2024
3c5da15
Conda setup experiment
mbackenkoehler Jan 29, 2024
a068799
setup mamba
mbackenkoehler Jan 29, 2024
50271d8
setup conda: channels
mbackenkoehler Jan 29, 2024
9e41700
ci work
mbackenkoehler Jan 29, 2024
dea0143
analystics
mbackenkoehler Jan 29, 2024
7927e40
Update ci.yml
mbackenkoehler Jan 29, 2024
a72d7ec
Update ci.yml
mbackenkoehler Jan 29, 2024
1981759
Update ci.yml
mbackenkoehler Jan 29, 2024
8007b4e
Update ci.yml
mbackenkoehler Jan 29, 2024
affecc3
Update ci.yml
mbackenkoehler Jan 29, 2024
e7b7f8a
Update ci.yml
mbackenkoehler Jan 29, 2024
7de8c59
Update ci.yml
mbackenkoehler Jan 29, 2024
8a6f64a
Update ci.yml
mbackenkoehler Jan 29, 2024
7402e84
ci
mbackenkoehler Jan 29, 2024
eb90a28
Update ci.yml
mbackenkoehler Jan 29, 2024
be875bc
Update ci.yml
mbackenkoehler Jan 29, 2024
2030f0d
Update ci.yml
mbackenkoehler Jan 29, 2024
2db7bd4
ci
mbackenkoehler Jan 29, 2024
c91afc0
ci
mbackenkoehler Jan 29, 2024
e6145ab
ci
mbackenkoehler Jan 29, 2024
365d962
ci black version
mbackenkoehler Jan 29, 2024
df71b4d
ci
mbackenkoehler Jan 29, 2024
ec0967d
Update ci.yml
mbackenkoehler Jan 29, 2024
5e20e87
Update ci.yml
mbackenkoehler Jan 29, 2024
e19f455
Update ci.yml
mbackenkoehler Jan 29, 2024
309f566
Update ci.yml
mbackenkoehler Jan 29, 2024
ab4eab7
symlinks to shared env
mbackenkoehler Feb 13, 2024
d80e333
Merge remote-tracking branch 'refs/remotes/origin/sepenv' into sepenv
mbackenkoehler Feb 13, 2024
9a5842c
add t001 to ci
mbackenkoehler Feb 13, 2024
d031575
ci
mbackenkoehler Feb 13, 2024
e8f2d5e
testing -> python script
mbackenkoehler Feb 27, 2024
aad4332
try-catch missing env fail
mbackenkoehler Feb 27, 2024
c0505bc
pyyaml for the special oss
mbackenkoehler Feb 27, 2024
bac432c
usemamba
mbackenkoehler Feb 27, 2024
a72ee60
setup-micromamba
mbackenkoehler Feb 27, 2024
6adc6b0
setup-miniconda
mbackenkoehler Feb 27, 2024
ea7fe50
test script: ret code set
mbackenkoehler Feb 27, 2024
9b000d9
stuff was commented out./.
mbackenkoehler Feb 27, 2024
9a89471
set exit codes correctly
mbackenkoehler Feb 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 20 additions & 70 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,97 +21,47 @@ jobs:
matrix:
cfg:
- os: ubuntu-latest
python-version: "3.8"
- os: ubuntu-latest
python-version: "3.9"
- os: macos-latest
python-version: "3.8"
- os: windows-latest
python-version: "3.8"

env:
PYVER: ${{ matrix.cfg.python-version }}
PACKAGE: teachopencadd

steps:
- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v2
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.cfg.python-version }}
miniforge-variant: Mambaforge
miniforge-version: latest
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
activate-environment: teachopencadd
environment-file: devtools/test_env.yml

- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a

- name: Install package
shell: bash -l {0}
run: |
pip install . --no-deps -vv

- name: Environment Information
shell: bash -l {0}
run: |
conda info --all
conda list

- name: Test CLI
shell: bash -l {0}
run: |
teachopencadd -h
pytest -v --cov=${PACKAGE} --cov-report=xml --color=yes ${PACKAGE}/tests/

- name: Run tests
shell: bash -l {0}
- name: Run Talktorials
shell: bash -el {0}
run: |
PYTEST_ARGS="--nbval-lax --current-env --dist loadscope --numprocesses 2"
python devtools/test_talktorials.py

PYTEST_IGNORE_T001="--ignore=teachopencadd/talktorials/T001_query_chembl/talktorial.ipynb"
PYTEST_IGNORE_T018="--ignore=teachopencadd/talktorials/T018_automated_cadd_pipeline/talktorial.ipynb"
PYTEST_IGNORE_T019="--ignore=teachopencadd/talktorials/T019_md_simulation/talktorial.ipynb"
PYTEST_IGNORE_T020="--ignore=teachopencadd/talktorials/T020_md_analysis/talktorial.ipynb"
PYTEST_IGNORE_T035="--ignore=teachopencadd/talktorials/T035_graph_neural_networks/talktorial.ipynb"
PYTEST_IGNORE_T036="--ignore=teachopencadd/talktorials/T036_e3_equivariant_gnn/talktorial.ipynb"
PYTEST_IGNORE_T038="--ignore=teachopencadd/talktorials/T038_protein_ligand_interaction_prediction/talktorial.ipynb"

IGNORE="$PYTEST_IGNORE_T001"

if [ "$RUNNER_OS" == "Windows" ]; then
# Ignore T019 under Windows, see https://github.com/volkamerlab/teachopencadd/issues/313
IGNORE="$IGNORE $PYTEST_IGNORE_T019"
IGNORE="$IGNORE $PYTEST_IGNORE_T035"
IGNORE="$IGNORE $PYTEST_IGNORE_T036"
IGNORE="$IGNORE $PYTEST_IGNORE_T038"
fi

if [ "$RUNNER_OS" == "Linux" ]; then
IGNORE="$IGNORE $PYTEST_IGNORE_T018" # see 385
fi

if [ "$RUNNER_OS" == "macOS" ]; then
IGNORE="$IGNORE $PYTEST_IGNORE_T018" # see 385
IGNORE="$IGNORE $PYTEST_IGNORE_T019"
IGNORE="$IGNORE $PYTEST_IGNORE_T035" # may cause kernel dying in pytest
IGNORE="$IGNORE $PYTEST_IGNORE_T036" # may cause kernel dying in pytest
fi
- name: Cache Conda packages
uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-
restore-keys: |
${{ runner.os }}-conda-

pytest $PYTEST_ARGS teachopencadd/talktorials/ $IGNORE

format:
name: Black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v3
- name: Install format dependencies
run: python -m pip install black-nb shyaml
run: python -m pip install 'black<23.1.0' black-nb shyaml
- name: Run black-nb
run: |
black-nb -l 99 --check teachopencadd/talktorials/T*/talktorial.ipynb
Expand All @@ -120,7 +70,7 @@ jobs:
name: READMEs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v3
- name: Install nbformat
run: python -m pip install nbformat shyaml
Expand Down
18 changes: 18 additions & 0 deletions devtools/environment_a.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: teachopencadd-a

channels:
- conda-forge
- defaults

dependencies:
- python=3.11
- jupyterlab
- notebook=7
- pandas=2
- pyarrow
- numpy
- rdkit=2023.9
- chembl_webresource_client=0.10
- iprogress
- ipywidgets=8
- tqdm
70 changes: 1 addition & 69 deletions devtools/test_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,72 +3,4 @@ channels:
- conda-forge
- defaults
dependencies:
- python>=3.8
- pip
- jupyterlab>=3
# Workaround for jupyterlab, see https://github.com/volkamerlab/teachopencadd/issues/310
- jsonschema>=4.3.0
- nglview>=3
# Workaround for nglview, see https://github.com/volkamerlab/teachopencadd/issues/262
- ipywidgets<=7.75
- jupyter_client<=7.4.9
# New numpy version 1.2.4 too young, e.g. caused
# https://github.com/volkamerlab/teachopencadd/issues/299
- numpy<1.24
- scikit-learn
# API changed after v2.6, see https://github.com/volkamerlab/teachopencadd/issues/265
- tensorflow<=2.6
- seaborn
- matplotlib-venn
- bravado
- requests
- requests-cache
- redo
- suds-community
- beautifulsoup4
- chembl_webresource_client
- pypdb
- biopython<=1.77
- biopandas
- rdkit
- openbabel
- opencadd
- biotite>=0.34.0
- smina
- mdanalysis>=1.0.0
- mdtraj
- plip
- openmm
- mkl < 2022
- pytorch::pytorch==1.13.0
#- pyg::pyg==2.2.0 # installed manually for now
# Dependency not included, see https://github.com/volkamerlab/teachopencadd/issues/313
# - openmmforcefields
- pdbfixer
- tqdm
- lxml
- kissim
## CI tests
- pytest
- pytest-xdist
- pytest-cov
- nbval
- shyaml
# Workaround for https://github.com/sphinx-doc/sphinx/issues/10289
- jinja2==3.0.3
## Docs
- sphinx
- sphinx-material
- nbsphinx
- recommonmark
- sphinx-autodoc-typehints
- sphinx-copybutton
- sphinx-gallery
- autodocsumm
- pip:
- black-nb
- nbsphinx-link
- sphinxext-opengraph
- deepchem
# TeachOpenCADD itself
- ../
- pyyaml
69 changes: 69 additions & 0 deletions devtools/test_talktorials.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import os
import sys
import subprocess
import pathlib
import yaml

HERE = pathlib.Path().absolute()


def create_conda_environment(env_file, env_name):
# Create Conda environment from environment file
env_path = HERE / "devtools" / env_file
assert env_path.exists(), f"No environment file {env_path} found."
# subprocess.run(f'mamba env remove -n {env_name}', check=False)
subprocess.run(
f"mamba env create -f {env_path} -n {env_name} -q".split(), check=True
)
subprocess.run(
f"mamba install -n {env_name} pytest pytest-xdist nbval -c conda-forge -y -q".split(),
check=True,
)


def deactivate_conda_environment():
# Deactivate Conda environment
subprocess.run(["conda", "deactivate"], shell=True, check=True)


def test_notebooks(notebooks, env_name):
# Run tests on Jupyter notebooks
success = True
for notebook in notebooks:
talktorial_path = (
HERE / "teachopencadd" / "talktorials" / notebook / "talktorial.ipynb"
)
assert talktorial_path.exists(), f"Talktorial {notebook} not found."
res = subprocess.run(
f"conda run -n {env_name} pytest --nbval {talktorial_path}".split()
)
success = (res == 0) and success
return success


def main():
# Load configuration from YAML file
with open("tests.yml", "r") as file:
config = yaml.safe_load(file)

success = True
for environment in config["environments"]:
env_name = environment["name"]
env_file = environment["file"]
notebooks = environment["notebooks"]

print(f"Setting up Conda environment '{env_name}'...")
create_conda_environment(env_file, env_name)

print(f"Running tests on Jupyter notebooks for environment '{env_name}'...")
success = success and test_notebooks(notebooks, env_name)

return success


if __name__ == "__main__":
success = main()
if success:
sys.exit(os.EX_OK)
else:
sys.exit(os.EX_SOFTWARE)
Loading