Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 4 additions & 7 deletions src/openfe/tests/protocols/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,17 +311,14 @@ def industry_benchmark_files():
)


@pytest.fixture
def t4_lysozyme_trajectory_universe():
# session scope for downstream reuse
@pytest.fixture(scope="session")
def t4_lysozyme_trajectory_dir():
zenodo_restraint_data.fetch("t4_lysozyme_trajectory.zip", processor=pooch.Unzip())
cache_dir = pathlib.Path(
POOCH_CACHE / "t4_lysozyme_trajectory.zip.unzip/t4_lysozyme_trajectory"
)
universe = mda.Universe(
str(cache_dir / "t4_toluene_complex.pdb"),
str(cache_dir / "t4_toluene_complex.xtc"),
)
return universe
return cache_dir


RFE_OUTPUT = pooch.create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,12 @@ class TestFindAnchorBondedTrajectory(TestFindAnchorMulti):
ref_h1h2_distance = 1.55881

@pytest.fixture(scope="class")
def universe(self, t4_lysozyme_trajectory_universe):
universe = t4_lysozyme_trajectory_universe
def universe(self, t4_lysozyme_trajectory_dir):
cache_dir = t4_lysozyme_trajectory_dir
universe = mda.Universe(
str(cache_dir / "t4_toluene_complex.pdb"),
str(cache_dir / "t4_toluene_complex.xtc"),
)
# guess bonds for the protein atoms
universe.select_atoms("protein").guess_bonds()
return universe
Expand Down
10 changes: 10 additions & 0 deletions src/openfe/tests/protocols/restraints/test_geometry_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,16 @@ def test_atomgroup_has_bonds(eg5_protein_pdb):
assert _atomgroup_has_bonds(ag)


@pytest.fixture()
def t4_lysozyme_trajectory_universe(t4_lysozyme_trajectory_dir):
cache_dir = t4_lysozyme_trajectory_dir
universe = mda.Universe(
str(cache_dir / "t4_toluene_complex.pdb"),
str(cache_dir / "t4_toluene_complex.xtc"),
)
return universe


@pytest.mark.skipif(
not os.path.exists(POOCH_CACHE) and not HAS_INTERNET,
reason="Internet seems to be unavailable and test data is not cached locally.",
Expand Down
Loading