Skip to content

Commit

Permalink
Fix Center when positions array is read-only
Browse files Browse the repository at this point in the history
  • Loading branch information
klarh committed Mar 7, 2022
1 parent fcddfe6 commit 2b06362
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flowws_analysis/Center.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ def run(self, scope, storage):

if index is not None:
center_point = positions[index]
positions -= center_point[np.newaxis]
positions = positions - center_point[np.newaxis]

if box is not None:
positions = wrap(box, positions)

elif box is None:
center_point = np.mean(positions, axis=0)
positions -= center_point[np.newaxis]
positions = positions - center_point[np.newaxis]

else:
positions = center(box, positions)
Expand Down

0 comments on commit 2b06362

Please sign in to comment.