Skip to content

Commit

Permalink
TEST3
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcello-Sega committed Aug 6, 2024
1 parent 2c62fcb commit 4ce0d12
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pytim/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def _define_cluster_group(self):
labels = np.array(labels)

# counts is not necessarily ordered by size of cluster.
sorting = np.argsort(counts)[::-1]
sorting = np.argsort(counts,stable=True)[::-1]
# labels for atoms in each cluster starting from the largest
unique_labels = np.sort(np.unique(labels[labels > -1]))
# by default, all elements of the cluster_group are in
Expand Down
2 changes: 1 addition & 1 deletion pytim/itim.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def _assign_layers(self):
_y = utilities.get_y(self.cluster_group, self.normal)
_z = utilities.get_z(self.cluster_group, self.normal)

sort = np.argsort(_z + _radius * np.sign(_z))
sort = np.argsort(_z + _radius * np.sign(_z),stable=True)
# NOTE: np.argsort returns the sorted *indices*

if self.multiproc and ('win' not in self.system.lower()):
Expand Down
4 changes: 2 additions & 2 deletions pytim/observables/contactangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def _fit_ellipse_fitzgibbon(x, y):
C = np.zeros((6, 6), dtype=float)
C[0, 2], C[2, 0], C[1, 1] = 2, 2, -1
eigval, eigvec = np.linalg.eig(np.linalg.solve(S, C))
sort = np.argsort(eigval)
sort = np.argsort(eigval,stable=True)
eigval, eigvec = eigval[sort], eigvec[sort]
lam = np.nonzero(np.logical_and(
eigval > 0, np.isfinite(eigval)))[0][-1]
Expand All @@ -515,7 +515,7 @@ def _fit_ellipse_flusser(x, y):
C = np.array(((0, 0, 2), (0, -1, 0), (2, 0, 0)), dtype=float)
M = np.linalg.solve(C, M)
eigval, eigvec = np.linalg.eig(M)
sort = np.argsort(eigval)[::-1]
sort = np.argsort(eigval,stable=True)[::-1]
eigval, eigvec = eigval[sort], eigvec[sort]
con = 4 * eigvec[0] * eigvec[2] - eigvec[1]**2 > 0
ak = eigvec[:, np.nonzero(con)[0]]
Expand Down

0 comments on commit 4ce0d12

Please sign in to comment.