fixed all nan slice issue

This commit is contained in:
davidpagnon 2024-06-09 12:29:02 +02:00
parent cd66285690
commit ac078342c8

View File

@ -229,6 +229,9 @@ def euclidean_distance(q1, q2):
q1 = np.array(q1)
q2 = np.array(q2)
dist = q2 - q1
if np.isnan(dist).all():
dist = np.empty_like(dist)
dist[...] = np.inf
euc_dist = np.sqrt(np.nansum( [d**2 for d in dist]))