permit NaN in embedding coordinates (#1631)

* permit NaN in embedding coordinates

* lint
This commit is contained in:
Bruce Martin
2020-07-16 11:43:56 -07:00
committed by GitHub
parent 3c6d90a4db
commit 2f700b377f
3 changed files with 15 additions and 8 deletions
+8 -2
View File
@@ -328,8 +328,14 @@ class DataAdaptor(metaclass=ABCMeta):
"""
# scale isotropically
min = embedding.min(axis=0)
max = embedding.max(axis=0)
try:
min = np.nanmin(embedding, axis=0)
max = np.nanmax(embedding, axis=0)
except RuntimeError:
# indicates entire array was NaN, which should propagate
min = np.NaN
max = np.NaN
scale = np.amax(max - min)
normalized_layout = (embedding - min) / scale