Skip to content

Commit ca20c47

Browse files
committed
update unit tests
1 parent 1b01480 commit ca20c47

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

cmeutils/tests/test_gsd.py

+22-2
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,31 @@ def test_frame_to_freud_system(self, butane_gsd):
3838
freud_sys = frame_to_freud_system(frame)
3939
assert isinstance(freud_sys, freud.locality.NeighborQuery)
4040

41-
def test_ellipsoid_gsd(self, butane_gsd):
42-
ellipsoid_gsd(butane_gsd, "ellipsoid.gsd", 0.5, 1.0)
41+
def test_ellipsoid_gsd(self, pekk_cg_gsd):
42+
ellipsoid_gsd(
43+
gsd_file=pekk_cg_gsd,
44+
new_file="ellipsoid.gsd",
45+
ellipsoid_types="E",
46+
lperp=0.5,
47+
lpar=1.0,
48+
)
49+
with gsd.hoomd.open(name="ellipsoid.gsd", mode="r") as f:
50+
snap = f[-1]
51+
assert snap.particles.type_shapes[0]["type"] == "Ellipsoid"
52+
assert snap.particles.type_shapes[1]["type"] == "Sphere"
53+
54+
def test_ellipsoid_gsd_multiple_types(self, pekk_cg_gsd):
55+
ellipsoid_gsd(
56+
gsd_file=pekk_cg_gsd,
57+
new_file="ellipsoid.gsd",
58+
ellipsoid_types=["E", "K"],
59+
lperp=0.5,
60+
lpar=1.0,
61+
)
4362
with gsd.hoomd.open(name="ellipsoid.gsd", mode="r") as f:
4463
snap = f[-1]
4564
assert snap.particles.type_shapes[0]["type"] == "Ellipsoid"
65+
assert snap.particles.type_shapes[1]["type"] == "Ellipsoid"
4666

4767
def test_get_type_position(self, gsdfile):
4868
pos_array = get_type_position(gsd_file=gsdfile, typename="A")

0 commit comments

Comments
 (0)