Skip to content

Commit

Permalink
Only check for nans once
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Avery <[email protected]>
  • Loading branch information
psavery committed Jan 4, 2024
1 parent 46011b7 commit a94d5cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hexrd/matrixutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,10 +686,10 @@ def findDuplicateVectors_old(vec, tol=vTol, equivPM=False):
def findDuplicateVectors(vec, tol=vTol, equivPM=False):
eqv = _findduplicatevectors(vec, tol, equivPM)
uid = np.arange(0, vec.shape[1], dtype=np.int64)
idx = eqv[~np.isnan(eqv)].astype(np.int64)
mask = ~np.isnan(eqv)
idx = eqv[mask].astype(np.int64)
uid2 = list(np.delete(uid, idx))
eqv2 = []
mask = ~np.isnan(eqv)
for ii in range(eqv.shape[1]):
v = eqv[ii, mask[ii, :]]
if v.shape[0] > 0:
Expand Down

0 comments on commit a94d5cd

Please sign in to comment.