Skip to content

Commit

Permalink
fix the path issue with pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
yihengwuKP committed May 24, 2024
1 parent 4897383 commit b2792a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/docker-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,22 +191,6 @@ jobs:
docker load --input /tmp/pysages.tar
docker run -t pysages bash -c "cd PySAGES/examples/openmm/cv_ermsd/ermsd_cg && python3 ./unbiased.py && python3 ./check_ermsd.py"
cv-rmsd-kabsch:
runs-on: ubuntu-latest
needs: build
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: pysages
path: /tmp
- name: Load and run test
run: |
docker load --input /tmp/pysages.tar
docker run -t pysages bash -c "cd PySAGES/tests && python3 ./test_rmsd.py"
alanine-dipeptide-string:
runs-on: ubuntu-latest
needs: build
Expand Down
12 changes: 6 additions & 6 deletions tests/test_rmsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@

from pysages.colvars.orientation import RMSD_Kabsch

base = np.loadtxt("./ci2_1.txt", dtype=str)[:, 6:9].astype(float)
reference = np.loadtxt("./ci2_2.txt", dtype=str)[:, 6:9].astype(float)
base = np.loadtxt("tests/ci2_1.txt", dtype=str)[:, 6:9].astype(float)
reference = np.loadtxt("tests/ci2_2.txt", dtype=str)[:, 6:9].astype(float)
indices = np.arange(len(base))
rmsd_kabsch = RMSD_Kabsch(indices, reference)
rmsd_calculated = rmsd_kabsch.function(base)
rmsd_expected = 11.7768
if not np.allclose(rmsd_expected, rmsd_calculated):
raise ValueError(f"Test Case PDB 1 failed: {rmsd_expected, rmsd_calculated}")

base = np.loadtxt("./ci2_1t.txt", dtype=str)[:, 6:9].astype(float)
reference = np.loadtxt("./ci2_1.txt", dtype=str)[:, 6:9].astype(float)
base = np.loadtxt("tests/ci2_1t.txt", dtype=str)[:, 6:9].astype(float)
reference = np.loadtxt("tests/ci2_1.txt", dtype=str)[:, 6:9].astype(float)
rmsd_kabsch = RMSD_Kabsch(indices, reference)
rmsd_calculated = rmsd_kabsch.function(base)
rmsd_expected = 0.0
if not np.allclose(rmsd_expected, rmsd_calculated, atol=1e-3):
raise ValueError(f"Test Case PDB 2 failed: {rmsd_expected, rmsd_calculated}")


base = np.loadtxt("./ci2_2.txt", dtype=str)[:, 6:9].astype(float)
reference = np.loadtxt("./ci2_12.txt", dtype=str)[:, 6:9].astype(float)
base = np.loadtxt("tests/ci2_2.txt", dtype=str)[:, 6:9].astype(float)
reference = np.loadtxt("tests/ci2_12.txt", dtype=str)[:, 6:9].astype(float)
rmsd_kabsch = RMSD_Kabsch(indices, reference)
rmsd_calculated = rmsd_kabsch.function(base)
rmsd_expected = 15.422431
Expand Down

0 comments on commit b2792a4

Please sign in to comment.