Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#1601)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Aug 22, 2024
1 parent dedc0b4 commit 0c459a0
Show file tree
Hide file tree
Showing 22 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.7
rev: v0.6.1
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
Expand Down
2 changes: 1 addition & 1 deletion src/testing/anndata/_pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _suppress_env_for_doctests(request: pytest.FixtureRequest) -> None:
request.getfixturevalue("_doctest_env")


@pytest.fixture()
@pytest.fixture
def _doctest_env(
request: pytest.FixtureRequest, cache: pytest.Cache, tmp_path: Path
) -> Generator[None, None, None]:
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from anndata.tests.helpers import subset_func # noqa: F401


@pytest.fixture()
@pytest.fixture
def backing_h5ad(tmp_path):
return tmp_path / "test.h5ad"

Expand Down
2 changes: 1 addition & 1 deletion tests/test_anncollection.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
_dense = lambda a: a.toarray() if issparse(a) else a


@pytest.fixture()
@pytest.fixture
def adatas(request):
adata1 = ad.AnnData(X=request.param([[1, 2, 0], [4, 5, 0], [7, 8, 0]]))
adata1.obs["a_test"] = ["a", "a", "b"]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_backed_dense.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def diskfmt(request):
return request.param


@pytest.fixture()
@pytest.fixture
def file(tmp_path: Path, diskfmt: Literal["h5ad", "zarr"]) -> h5py.File | zarr.Group:
path = tmp_path / f"test.{diskfmt}"
if diskfmt == "zarr":
Expand Down
2 changes: 1 addition & 1 deletion tests/test_backed_hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# -------------------------------------------------------------------------------


@pytest.fixture()
@pytest.fixture
def adata():
X_list = [
[1, 2, 3],
Expand Down
2 changes: 1 addition & 1 deletion tests/test_backed_sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def diskfmt(request):
N = 50


@pytest.fixture()
@pytest.fixture
def ondisk_equivalent_adata(
tmp_path: Path, diskfmt: Literal["h5ad", "zarr"]
) -> tuple[AnnData, AnnData, AnnData, AnnData]:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_concatenate.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def test_concatenate_layers(array_type, join_type):
assert_equal(merged.X, merged.layers["a"])


@pytest.fixture()
@pytest.fixture
def obsm_adatas():
def gen_index(n):
return [f"cell{i}" for i in range(n)]
Expand Down Expand Up @@ -1575,7 +1575,7 @@ def test_concat_duplicated_columns(join_type):
concat([a, b], join=join_type)


@pytest.mark.gpu()
@pytest.mark.gpu
def test_error_on_mixed_device():
"""https://github.com/scverse/anndata/issues/1083"""
import cupy
Expand Down
2 changes: 1 addition & 1 deletion tests/test_concatenate_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def test_concat_ordered_categoricals_retained(tmp_path, file_format):
assert_eq_concat_on_disk(adatas, tmp_path, file_format)


@pytest.fixture()
@pytest.fixture
def xxxm_adatas():
def gen_index(n):
return [f"cell{i}" for i in range(n)]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def diskfmt(request):
return request.param


@pytest.fixture()
@pytest.fixture
def adata(sizes):
import dask.array as da
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dask_view_mem.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def give_chunks(request):

# Does some stuff so that dask can cache the
# subclasscheck before the run.
@pytest.fixture()
@pytest.fixture
def _alloc_cache():
import dask.array as da

Expand Down
2 changes: 1 addition & 1 deletion tests/test_deprecations.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from anndata.tests.helpers import assert_equal


@pytest.fixture()
@pytest.fixture
def adata():
adata = AnnData(
X=sparse.csr_matrix([[0, 2, 3], [0, 5, 6]], dtype=np.float32),
Expand Down
6 changes: 3 additions & 3 deletions tests/test_gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from anndata import AnnData, Raw


@pytest.mark.gpu()
@pytest.mark.gpu
def test_gpu():
"""
For testing that the gpu mark works
Expand All @@ -16,7 +16,7 @@ def test_gpu():
cupy.ones(1)


@pytest.mark.gpu()
@pytest.mark.gpu
def test_adata_raw_gpu():
import cupy as cp
from cupyx.scipy import sparse as cupy_sparse
Expand All @@ -28,7 +28,7 @@ def test_adata_raw_gpu():
assert isinstance(adata.raw.X, sparse.csr_matrix)


@pytest.mark.gpu()
@pytest.mark.gpu
def test_raw_gpu():
import cupy as cp
from cupyx.scipy import sparse as cupy_sparse
Expand Down
4 changes: 2 additions & 2 deletions tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
# assert tag in str(err.value)


@pytest.fixture()
@pytest.fixture
def reusable_adata():
"""Reusable anndata for when tests shouldn’t mutate it"""
return gen_adata((10, 10))
Expand Down Expand Up @@ -333,7 +333,7 @@ def test_as_dask_functions(input_type, as_dask_type, mem_type):
"dask_matrix_type",
DASK_MATRIX_PARAMS,
)
@pytest.mark.gpu()
@pytest.mark.gpu
def test_as_cupy_dask(dask_matrix_type):
SHAPE = (100, 10)
rng = np.random.default_rng(42)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_io_elementwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def test_io_spec(store, value, encoding_type):


# Can't instantiate cupy types at the top level, so converting them within the test
@pytest.mark.gpu()
@pytest.mark.gpu
@pytest.mark.parametrize(
("value", "encoding_type"),
[
Expand Down
2 changes: 1 addition & 1 deletion tests/test_obsmvarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
M, N = (100, 100)


@pytest.fixture()
@pytest.fixture
def adata():
X = np.zeros((M, N))
obs = pd.DataFrame(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_obspvarp.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
M, N = (200, 100)


@pytest.fixture()
@pytest.fixture
def adata():
X = np.zeros((M, N))
obs = pd.DataFrame(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
)


@pytest.fixture()
@pytest.fixture
def adata_raw() -> ad.AnnData:
adata = ad.AnnData(
np.array(data, dtype="int32"), obs=obs_dict, var=var_dict, uns=uns_dict
Expand Down
2 changes: 1 addition & 1 deletion tests/test_readwrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def diskfmt(request):
return request.param


@pytest.fixture()
@pytest.fixture
def rw(backing_h5ad):
M, N = 100, 101
orig = gen_adata((M, N))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_repr.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
ADATA_ATTRS = ("obs", "var", "varm", "obsm", "layers", "obsp", "varp", "uns")


@pytest.fixture()
@pytest.fixture
def adata():
return ad.AnnData(
np.zeros((20, 10)),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def validate_int_list(val) -> bool:
return True


@pytest.fixture()
@pytest.fixture
def settings() -> SettingsManager:
settings = SettingsManager()
settings.register(option, default_val, description, validate_bool)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def view(self, dtype=None, typ=None):
return self


@pytest.fixture()
@pytest.fixture
def adata():
adata = ad.AnnData(np.zeros((100, 100)))
adata.obsm["o"] = np.zeros((100, 50))
Expand Down

0 comments on commit 0c459a0

Please sign in to comment.