Skip to content

Commit

Permalink
Add support for freud 3.0 (#93)
Browse files Browse the repository at this point in the history
* fix parameter in cluster module

* update version to match what we are using on conda-forge

* use box module to get vectors

* update version
  • Loading branch information
chrisjonesBSU authored Jun 19, 2024
1 parent 18d8797 commit 7d00de9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmeutils/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.1.1"
__version__ = "1.3.0"
16 changes: 13 additions & 3 deletions cmeutils/gsd_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,21 @@ def get_molecule_cluster(gsd_file=None, snap=None, gsd_frame=-1):
n_query_points = n_points = snap.particles.N
query_point_indices = snap.bonds.group[:, 0]
point_indices = snap.bonds.group[:, 1]
distances = system.box.compute_distances(
system.points[query_point_indices], system.points[point_indices]
box = freud.box.Box(
snap.configuration.box[0],
snap.configuration.box[1],
snap.configuration.box[2],
)
vectors = box.wrap(
snap.particles.position[query_point_indices]
- snap.particles.position[point_indices]
)
nlist = freud.NeighborList.from_arrays(
n_query_points, n_points, query_point_indices, point_indices, distances
num_query_points=n_query_points,
num_points=n_points,
query_point_indices=query_point_indices,
point_indices=point_indices,
vectors=vectors,
)
cluster = freud.cluster.Cluster()
cluster.compute(system=system, neighbors=nlist)
Expand Down
2 changes: 1 addition & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: cmeutils-dev
channels:
- conda-forge
dependencies:
- freud =2.13.2
- freud >= 3.0
- gmso >=0.11.2
- fresnel >=0.13.5
- gsd >=3.0
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: cmeutils
channels:
- conda-forge
dependencies:
- freud =2.13.2
- freud >= 3.0
- gmso >=0.11.2
- fresnel >=0.13.5
- gsd >=3.0
Expand Down

0 comments on commit 7d00de9

Please sign in to comment.