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
2 changes: 1 addition & 1 deletion cmeutils/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.5.0"
__version__ = "1.5.1"
4 changes: 2 additions & 2 deletions cmeutils/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,8 @@ def gsd_rdf(
nlist = filter_nlist(
nlist=nlist,
excluded_pairs_encoded=excluded_pairs_encoded,
query_indices=type_A_indices,
point_indices=type_B_indices,
query_indices=type_B_indices,
point_indices=type_A_indices,
max_idx=snap.particles.N,
)

Expand Down
15 changes: 15 additions & 0 deletions cmeutils/tests/test_gsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
get_type_position,
identify_snapshot_connections,
snap_delete_types,
snapshot_to_graph,
xml_to_gsd,
)

Expand All @@ -33,6 +34,20 @@


class TestGSD(BaseTest):
def test_snapshot_to_graph(self, pekk_cg_gsd, p3ht_gsd):
# Test on a GSD file with a single chain
with gsd.hoomd.open(pekk_cg_gsd) as traj:
snap = traj[0]
graph = snapshot_to_graph(snap)
assert snap.particles.N == graph.number_of_nodes()
assert snap.bonds.N == graph.number_of_edges()
# Test on a GSD file with multiple independent chains
with gsd.hoomd.open(p3ht_gsd) as traj:
snap = traj[0]
graph = snapshot_to_graph(snap)
assert snap.particles.N == graph.number_of_nodes()
assert snap.bonds.N == graph.number_of_edges()

def test_get_centers(self, gsdfile):
new_gsdfile = "centers.gsd"
centers = get_centers(gsdfile, new_gsdfile)
Expand Down
Loading