From 580cc7a4a6985da059c24cce4f77504896adbdbb Mon Sep 17 00:00:00 2001 From: Intron7 Date: Thu, 19 Dec 2024 17:19:00 +0100 Subject: [PATCH] update test --- tests/dask/test_get.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/dask/test_get.py b/tests/dask/test_get.py index 9d096a03..e6594fa7 100644 --- a/tests/dask/test_get.py +++ b/tests/dask/test_get.py @@ -28,12 +28,32 @@ def test_get_anndata(client, data_kind): assert type(adata.X) is type(dask_adata.X._meta) + if data_kind == "sparse": + cp.testing.assert_array_equal( + adata.X.toarray(), dask_adata.X.compute().toarray() + ) + else: + cp.testing.assert_array_equal(adata.X, dask_adata.X.compute()) + rsc.get.anndata_to_CPU(dask_adata) rsc.get.anndata_to_CPU(adata) assert type(adata.X) is type(dask_adata.X._meta) + if data_kind == "sparse": + cp.testing.assert_array_equal( + adata.X.toarray(), dask_adata.X.compute().toarray() + ) + else: + cp.testing.assert_array_equal(adata.X, dask_adata.X.compute()) rsc.get.anndata_to_GPU(dask_adata) rsc.get.anndata_to_GPU(adata) assert type(adata.X) is type(dask_adata.X._meta) + + if data_kind == "sparse": + cp.testing.assert_array_equal( + adata.X.toarray(), dask_adata.X.compute().toarray() + ) + else: + cp.testing.assert_array_equal(adata.X, dask_adata.X.compute())