Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax AWS deps & Skip tests #60

Merged
merged 2 commits into from
Aug 7, 2024
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
3 changes: 0 additions & 3 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ dependencies:
### AWS dependencies ###
# AWS reading/writing
- s3fs>=2024.3.0
- aiobotocore=2.12.1
- botocore>=1.34.41,<1.34.52
- boto3>=1.9.201
# AWS testing
- moto[server]>=5.0.3

Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ test = [
"pytest-cov>=4.1.0",
"MDAnalysisTests>=2.1.0",
"moto[server]>=5.0.3",
"aiobotocore==2.12.1",
"botocore>=1.34.41,<1.34.52",
"boto3>=1.9.201",
"pip",
"codecov",
]
Expand Down
66 changes: 66 additions & 0 deletions zarrtraj/tests/test_zarrtraj.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,72 @@ def ref(request):
class TestH5MDFmtReaderBaseAPI(MultiframeReaderTest):
"""Tests ZarrTrajReader with with synthetic trajectory."""

@pytest.mark.parametrize("asel", ("index 1", "index 2", "index 1 to 3"))
def test_timeseries_asel_shape(self, reader, asel, ref):
if ref.trajectory.startswith("s3") and ref.trajectory.endswith(
".zarrmd"
):
pytest.skip("Duplicate key issue with moto")
atoms = mda.Universe(reader.filename).select_atoms("index 1")
timeseries = reader.timeseries(atoms, order="fac")
assert timeseries.shape[0] == len(reader)
assert timeseries.shape[1] == len(atoms)
assert timeseries.shape[2] == 3

def test_timeseries_empty_asel(self, reader, ref):
if ref.trajectory.startswith("s3") and ref.trajectory.endswith(
".zarrmd"
):
pytest.skip("Duplicate key issue with moto")
with pytest.warns(
UserWarning,
match="Empty string to select atoms, empty group returned.",
):
atoms = mda.Universe(reader.filename).select_atoms(None)
with pytest.raises(ValueError, match="Timeseries requires at least"):
reader.timeseries(asel=atoms)

def test_timeseries_empty_atomgroup(self, reader, ref):
if ref.trajectory.startswith("s3") and ref.trajectory.endswith(
".zarrmd"
):
pytest.skip("Duplicate key issue with moto")
with pytest.warns(
UserWarning,
match="Empty string to select atoms, empty group returned.",
):
atoms = mda.Universe(reader.filename).select_atoms(None)
with pytest.raises(ValueError, match="Timeseries requires at least"):
reader.timeseries(atomgroup=atoms)

def test_timeseries_asel_warns_deprecation(self, reader, ref):
if ref.trajectory.startswith("s3") and ref.trajectory.endswith(
".zarrmd"
):
pytest.skip("Duplicate key issue with moto")
atoms = mda.Universe(reader.filename).select_atoms("index 1")
with pytest.warns(DeprecationWarning, match="asel argument to"):
timeseries = reader.timeseries(asel=atoms, order="fac")

def test_timeseries_atomgroup(self, reader, ref):
if ref.trajectory.startswith("s3") and ref.trajectory.endswith(
".zarrmd"
):
pytest.skip("Duplicate key issue with moto")
atoms = mda.Universe(reader.filename).select_atoms("index 1")
timeseries = reader.timeseries(atomgroup=atoms, order="fac")

def test_timeseries_atomgroup_asel_mutex(self, reader, ref):
if ref.trajectory.startswith("s3") and ref.trajectory.endswith(
".zarrmd"
):
pytest.skip("Duplicate key issue with moto")
atoms = mda.Universe(reader.filename).select_atoms("index 1")
with pytest.raises(ValueError, match="Cannot provide both"):
timeseries = reader.timeseries(
atomgroup=atoms, asel=atoms, order="fac"
)


# H5MD Format Reader Tests
# Only test these with disk to avoid excessive test length
Expand Down
Loading