Skip to content

Commit

Permalink
CI: integrating more talktorials
Browse files Browse the repository at this point in the history
  • Loading branch information
mbackenkoehler committed Feb 28, 2024
1 parent 6e20b5a commit 25569b3
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 5 deletions.
1 change: 0 additions & 1 deletion devtools/environment_a.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ dependencies:
- chembl_webresource_client=0.10
- iprogress
- ipywidgets=8
-
4 changes: 4 additions & 0 deletions devtools/environment_b.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@ dependencies:
- ipywidgets
- tqdm
- scikit-learn
- pdbfixer
- tensorflow
- seaborn
- biotite
- pip:
- ..
7 changes: 7 additions & 0 deletions devtools/environment_c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies:
- python=3.9
- jupyterlab
- pandas=2.1.4
- numpy
- notebook=7
- tqdm
- pyarrow
Expand All @@ -21,3 +22,9 @@ dependencies:
- requests-cache
- bravado=11
- matplotlib-venn
- plip
- openbabel
- smina
- seaborn
- scikit-learn
- kissim
14 changes: 14 additions & 0 deletions devtools/environment_f.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: teachopencadd-e

channels:
- conda-forge
- defaults

dependencies:
- python=3.11
- jupyterlab
- pandas
- pyarrow
- seaborn
- biotite
- scikit-learn
24 changes: 20 additions & 4 deletions devtools/test_configurations.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
environments:
#- name: teachopencadd-a
#file: environment_a.yml
#notebooks:
#- T001_query_chembl
- name: teachopencadd-a
file: environment_a.yml
notebooks:
- T001_query_chembl
- name: teachopencadd-b
file: environment_b.yml
notebooks:
Expand All @@ -13,12 +13,21 @@ environments:
- T006_compound_maximum_common_substructures
- T007_compound_activity_machine_learning
- T013_query_pubchem
# - T019_md_simulation
- T021_one_hot_encoding
- T027_kinase_similarity_ligand_profile
- name: teachopencadd-c
file: environment_c.yml
notebooks:
- T008_query_pdb
- T012_query_klifs
- T014_binding_site_detection
- T015_protein_ligand_docking
- T016_protein_ligand_interactions
- T017_advanced_nglview_usage
- T023_what_is_a_kinase
- T025_kinase_similarity_kissim
- T026_kinase_similarity_ifp
- name: teachopencadd-d
file: environment_d.yml
notebooks:
Expand All @@ -27,3 +36,10 @@ environments:
file: environment_e.yml
notebooks:
- T010_binding_site_comparison
#
- name: teachopencadd-f
file: environment_f.yml
notebooks:
- T024_kinase_similarity_sequence
- T028_kinase_similarity_compare_perspectiv
# MISSING: T011 T018
12 changes: 12 additions & 0 deletions devtools/test_talktorials.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@
import sys
import subprocess
import pathlib
import platform
import yaml

HERE = pathlib.Path().absolute()
PYTEST_ARGS = "--nbval-lax --nbval-current-env --dist loadscope --numprocesses 4"


def setup_mamba():
if platform.system() == "Windows":
subprocess.run("conda config --add channels conda-forge".split(), check=True)
subprocess.run("conda update -n base --all".split(), check=True)
subprocess.run("conda install -n base mamba".split(), check=True)


def create_conda_environment(env_file, env_name):
# Create Conda environment from environment file
env_path = HERE / "devtools" / env_file
Expand Down Expand Up @@ -45,10 +53,14 @@ def main():
env_file = environment["file"]
notebooks = environment["notebooks"]

print("Set up mamba")
setup_mamba()

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}'...")
print(f"\n".join(" - " + nb for nb in notebooks))
res = test_notebooks(notebooks, env_name)
success = success and res

Expand Down

0 comments on commit 25569b3

Please sign in to comment.