Skip to content

Commit

Permalink
fixes to compute calls
Browse files Browse the repository at this point in the history
  • Loading branch information
DomFijan committed Jan 21, 2025
1 parent 7be7c1c commit 7018281
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions freud/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,7 @@ def point_environments(self):
""":math:`\\left(N_{points}, N_{neighbors}, 3\\right)`
list[:class:`numpy.ndarray`]: All environments for all points."""
envs = self._cpp_obj.getPointEnvironments()
return [np.asarray([[p.x, p.y, p.z] for p in env])
for env in envs]
return [np.asarray(env) for env in envs]

def __repr__(self):
return (f"freud.environment.{type(self).__name__}()")
Expand Down Expand Up @@ -772,6 +771,7 @@ def compute(self, system, threshold, cluster_neighbors=None,

self._cpp_obj.compute(
nq._cpp_obj,
nlist._cpp_obj,
qargs._cpp_obj,
env_nlist._cpp_obj,
env_qargs._cpp_obj,
Expand All @@ -795,8 +795,7 @@ def cluster_environments(self):
""":math:`\\left(N_{clusters}, N_{neighbors}, 3\\right)`
list[:class:`numpy.ndarray`]: The environments for all clusters."""
envs = self._cpp_obj.getClusterEnvironments()
return [np.asarray([[p.x, p.y, p.z] for p in env])
for env in envs]
return [np.asarray(env) for env in envs]

def plot(self, ax=None):
"""Plot cluster distribution.
Expand Down

0 comments on commit 7018281

Please sign in to comment.