From a8c62e8b7ffaac41553056a823ddff662fffd42c Mon Sep 17 00:00:00 2001 From: Ilan Gold Date: Fri, 10 Jan 2025 10:37:24 -0500 Subject: [PATCH] (fix): remove `loompy` xfail (#1820) --- src/testing/anndata/_helpers.py | 11 ----------- tests/test_layers.py | 2 -- tests/test_readwrite.py | 3 --- 3 files changed, 16 deletions(-) delete mode 100644 src/testing/anndata/_helpers.py diff --git a/src/testing/anndata/_helpers.py b/src/testing/anndata/_helpers.py deleted file mode 100644 index c043ca7e8..000000000 --- a/src/testing/anndata/_helpers.py +++ /dev/null @@ -1,11 +0,0 @@ -from __future__ import annotations - -import numpy as np -import pytest -from packaging.version import Version - -xfail_if_numpy2_loompy = pytest.mark.xfail( - Version(np.__version__) >= Version("2a0"), - reason="loompy still uses `np.string_`, removed in `numpy==2.0`", - raises=AttributeError, -) diff --git a/tests/test_layers.py b/tests/test_layers.py index ba1f96e49..380e51d3b 100644 --- a/tests/test_layers.py +++ b/tests/test_layers.py @@ -10,7 +10,6 @@ from anndata import AnnData, ImplicitModificationWarning, read_h5ad, read_loom from anndata.tests.helpers import gen_typed_df_t2_size -from testing.anndata._helpers import xfail_if_numpy2_loompy X = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) L = np.array([[10, 11, 12], [13, 14, 15], [16, 17, 18]]) @@ -77,7 +76,6 @@ def test_readwrite(backing_h5ad): assert (adata.layers["L"] == adata_read.layers["L"]).all() -@xfail_if_numpy2_loompy @pytest.mark.skipif(find_spec("loompy") is None, reason="loompy not installed") def test_readwrite_loom(tmp_path): loom_path = tmp_path / "test.loom" diff --git a/tests/test_readwrite.py b/tests/test_readwrite.py index a43111a06..1dab39e68 100644 --- a/tests/test_readwrite.py +++ b/tests/test_readwrite.py @@ -22,7 +22,6 @@ from anndata._io.specs.registry import IORegistryError from anndata.compat import DaskArray, SpArray, _read_attr from anndata.tests.helpers import as_dense_dask_array, assert_equal, gen_adata -from testing.anndata._helpers import xfail_if_numpy2_loompy if TYPE_CHECKING: from os import PathLike @@ -380,7 +379,6 @@ def test_changed_obs_var_names(tmp_path, diskfmt): assert_equal(read, modified, exact=True) -@xfail_if_numpy2_loompy @pytest.mark.skipif(not find_spec("loompy"), reason="Loompy is not installed") @pytest.mark.parametrize("typ", [np.array, csr_matrix]) @pytest.mark.parametrize("obsm_mapping", [{}, dict(X_composed=["oanno3", "oanno4"])]) @@ -438,7 +436,6 @@ def test_readwrite_loom(typ, obsm_mapping, varm_mapping, tmp_path): assert adata.var_names.name == var_dim -@xfail_if_numpy2_loompy @pytest.mark.skipif(not find_spec("loompy"), reason="Loompy is not installed") def test_readloom_deprecations(tmp_path): loom_pth = tmp_path / "test.loom"