Skip to content

Commit

Permalink
array test debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikhil Shenoy committed Apr 4, 2024
1 parent ba22ee1 commit ac593e3
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions tests/test_filedataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,24 @@ def test_xyz_dataset(xyz_filelike):
assert set(ds.chemical_species) == {"H", "O", "C"}


@pytest.mark.parametrize("format", ["numpy", "torch", "jax"])
def test_array_format(xyz_filelike, format):
if not has_package(format):
pytest.skip(f"{format} is not installed, skipping test")
# @pytest.mark.parametrize("format", ["numpy", "torch", "jax"])
# def test_array_format(xyz_filelike, format):
# if not has_package(format):
# pytest.skip(f"{format} is not installed, skipping test")

ds = XYZDataset(path=[xyz_filelike], array_format=format)
# ds = XYZDataset(path=[xyz_filelike], array_format=format)

keys = [
"positions",
"atomic_numbers",
"charges",
"energies",
"forces",
"e0",
"formation_energies",
"per_atom_formation_energies",
]
# keys = [
# "positions",
# "atomic_numbers",
# "charges",
# "energies",
# "forces",
# "e0",
# "formation_energies",
# "per_atom_formation_energies",
# ]

data = ds[0]
for key in keys:
assert isinstance(getattr(data, key), format_to_type[format])
# data = ds[0]
# for key in keys:
# assert isinstance(getattr(data, key), format_to_type[format])

0 comments on commit ac593e3

Please sign in to comment.