X float16 support (#2406)

* float16 support

* fix type checks

* PR review comments

* add tests for custom json encoder; rename and comment for posterity

* lint

* typos
This commit is contained in:
Bruce Martin
2021-08-25 11:12:49 -07:00
committed by Colin Megill
parent eaae6df5e3
commit 154d099fef
8 changed files with 102 additions and 15 deletions
@@ -232,7 +232,7 @@ class AnndataAdaptor(DataAdaptor):
"Anndata data matrix is sparse, but not a CSC (columnar) matrix. "
"Performance may be improved by using CSC."
)
if self.data.X.dtype != "float32":
if self.data.X.dtype > np.dtype(np.float32):
warnings.warn(
f"Anndata data matrix is in {self.data.X.dtype} format not float32. " f"Precision may be truncated."
)