mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-24 00:48:12 +08:00
* Fix float16 support [#2379] Convert to float32 on startup unless backed, in which case error. scipy does not support complex slicing from float16 data so this is the easiest fix for now. * minor msg change
This commit is contained in:
Vendored
BIN
Binary file not shown.
@@ -1,5 +1,4 @@
|
||||
import json
|
||||
import sys
|
||||
import time
|
||||
import unittest
|
||||
|
||||
@@ -37,6 +36,7 @@ Test the anndata adaptor using the pbmc3k data set.
|
||||
(f"{FIXTURES_ROOT}/pbmc3k-CSC-gz.h5ad", True, "normal"),
|
||||
(f"{FIXTURES_ROOT}/pbmc3k-CSR-gz.h5ad", True, "normal"),
|
||||
(f"{FIXTURES_ROOT}/pbmc3k_64.h5ad", False, "auto"), # 64 bit conversion tests
|
||||
(f"{FIXTURES_ROOT}/pbmc3k_16.h5ad", False, "auto"), # 16 bit conversion tests
|
||||
],
|
||||
)
|
||||
class AdaptorTest(unittest.TestCase):
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import unittest
|
||||
|
||||
from parameterized import parameterized_class
|
||||
|
||||
from server.common.errors import DatasetAccessError
|
||||
from test import FIXTURES_ROOT
|
||||
from test.unit import app_config
|
||||
|
||||
|
||||
@parameterized_class(
|
||||
("data_locator", "backed", "X_approximate_distribution"),
|
||||
[
|
||||
(f"{FIXTURES_ROOT}/pbmc3k_16.h5ad", True, "auto"), # 16 bit conversion tests
|
||||
],
|
||||
)
|
||||
class AdaptorLoadErrorTest(unittest.TestCase):
|
||||
def test_float16_backed_raises_err(self):
|
||||
with self.assertRaises(DatasetAccessError):
|
||||
config = app_config(
|
||||
self.data_locator,
|
||||
backed=self.backed,
|
||||
extra_dataset_config=dict(X_approximate_distribution=self.X_approximate_distribution),
|
||||
)
|
||||
Reference in New Issue
Block a user