Skip to content
17 changes: 11 additions & 6 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,20 @@ jobs:
python-version: ['3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv and activate environment
uses: astral-sh/setup-uv@v7
with:
# Use uv venv to activate a venv ready to be used by later steps
activate-environment: "true"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e '.[test]'
run: uv pip install -e '.[test,pkaani]'
env:
UV_TORCH_BACKEND: cpu
- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
Expand All @@ -41,12 +46,12 @@ jobs:
- name: Upload coverage results
run: bash <(curl -s https://codecov.io/bash)
- name: Store coverage text results
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: coverage-text-my-${{ matrix.python-version }}
path: coverage.txt
- name: Store coverage HTML results
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: coverage-html-${{ matrix.python-version }}
path: htmlcov/*
2 changes: 0 additions & 2 deletions tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ def run_pkaani_for_tests(input_pdb, compare_file, pH):
for key, val in results.items():
f.write(f"{key},{val}\n")


compare = {}
with open(compare_file) as f:
for line in f.readlines()[1:]:
Expand All @@ -349,4 +348,3 @@ def run_pkaani_for_tests(input_pdb, compare_file, pH):
raise RuntimeError(
f"pKa-ANI test error. pKa values changed more than 1e-3 for group {key}: new {results[key]} reference {compare[key]}"
)

25 changes: 18 additions & 7 deletions tests/pkaani_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
import common
import pytest

PKAANI_TEST_DIR = Path("pkaani_tests")
PKAANI_TEST_DIR = Path("tests/pkaani_tests")


@pytest.mark.parametrize(
"input_pdb",
[str(PKAANI_TEST_DIR / "1brs_clean.pdb"), str(PKAANI_TEST_DIR / "1zy8_clean.pdb"), str(PKAANI_TEST_DIR / "6oge_de.pdb"), "1FCC.pdb"
], ids=str
"input_pdb",
[
str(PKAANI_TEST_DIR / "1brs_clean.pdb"),
str(PKAANI_TEST_DIR / "1zy8_clean.pdb"),
str(PKAANI_TEST_DIR / "6oge_de.pdb"),
"1FCC.pdb",
],
ids=str,
)
def test_pkaani_apo(input_pdb, tmp_path):
"""PKAANI non-regression tests on biomolecules without ligands."""
Expand All @@ -28,9 +34,14 @@ def test_pkaani_apo(input_pdb, tmp_path):


@pytest.mark.parametrize(
"input_pdb",
[str(PKAANI_TEST_DIR / "1brs_clean.pdb"), str(PKAANI_TEST_DIR / "1zy8_clean.pdb"), str(PKAANI_TEST_DIR / "6oge_de.pdb"), "1FCC.pdb"
], ids=str
"input_pdb",
[
str(PKAANI_TEST_DIR / "1brs_clean.pdb"),
str(PKAANI_TEST_DIR / "1zy8_clean.pdb"),
str(PKAANI_TEST_DIR / "6oge_de.pdb"),
"1FCC.pdb",
],
ids=str,
)
def test_pkaani_pka(input_pdb):
"""PKAANI non-regression tests for pKa values on biomolecules without ligands."""
Expand Down
Loading