Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#3210)
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 89dcf21 commit b619350
Show file tree
Hide file tree
Showing 22 changed files with 39 additions and 39 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/scanpy/_pytest/fixtures/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def float_dtype(request):
return request.param


@pytest.fixture()
@pytest.fixture
def _doctest_env(cache: pytest.Cache, tmp_path: Path) -> Generator[None, None, None]:
from scanpy._compat import chdir

Expand Down
4 changes: 2 additions & 2 deletions src/testing/scanpy/_pytest/fixtures/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ def pbmc3ks_parametrized_session(request) -> dict[bool, AnnData]:
}


@pytest.fixture()
@pytest.fixture
def pbmc3k_parametrized(pbmc3ks_parametrized_session) -> Callable[[], AnnData]:
return pbmc3ks_parametrized_session[False].copy


@pytest.fixture()
@pytest.fixture
def pbmc3k_parametrized_small(pbmc3ks_parametrized_session) -> Callable[[], AnnData]:
return pbmc3ks_parametrized_session[True].copy

Expand Down
8 changes: 4 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _caplog_adapter(caplog: pytest.LogCaptureFixture) -> Generator[None, None, N
sc.settings._root_logger.removeHandler(caplog.handler)


@pytest.fixture()
@pytest.fixture
def imported_modules():
return IMPORTED

Expand All @@ -69,7 +69,7 @@ class CompareResult(TypedDict):
tol: int


@pytest.fixture()
@pytest.fixture
def check_same_image(add_nunit_attachment):
from urllib.parse import quote

Expand Down Expand Up @@ -117,7 +117,7 @@ def fmt_descr(descr):
return check_same_image


@pytest.fixture()
@pytest.fixture
def image_comparer(check_same_image):
from matplotlib import pyplot as plt

Expand All @@ -139,7 +139,7 @@ def save_and_compare(*path_parts: Path | os.PathLike, tol: int):
return save_and_compare


@pytest.fixture()
@pytest.fixture
def plt():
from matplotlib import pyplot as plt

Expand Down
6 changes: 3 additions & 3 deletions tests/test_aggregated.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ def metric(request: pytest.FixtureRequest) -> AggType:
return request.param


@pytest.fixture()
@pytest.fixture
def df_base():
ax_base = ["A", "B"]
return pd.DataFrame(index=ax_base)


@pytest.fixture()
@pytest.fixture
def df_groupby():
ax_groupby = [
*["v0", "v1", "v2"],
Expand All @@ -49,7 +49,7 @@ def df_groupby():
return df_groupby


@pytest.fixture()
@pytest.fixture
def X():
data = [
*[[0, -2], [1, 13], [2, 1]], # v
Expand Down
2 changes: 1 addition & 1 deletion tests/test_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
HERE = Path(__file__).parent


@pytest.fixture()
@pytest.fixture
def _set_path(monkeypatch: MonkeyPatch) -> None:
monkeypatch.setenv("PATH", str(HERE / "_scripts"), prepend=os.pathsep)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from testing.scanpy._pytest.marks import needs


@pytest.fixture()
@pytest.fixture
def adata_neighbors():
return pbmc68k_reduced()

Expand Down
18 changes: 9 additions & 9 deletions tests/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ def _tmp_dataset_dir(tmp_path: Path) -> None:
sc.settings.datasetdir = tmp_path / "scanpy_data"


@pytest.mark.internet()
@pytest.mark.internet
def test_burczynski06():
with pytest.warns(UserWarning, match=r"Variable names are not unique"):
adata = sc.datasets.burczynski06()
assert adata.shape == (127, 22283)
assert not (adata.X == 0).any()


@pytest.mark.internet()
@pytest.mark.internet
@needs.openpyxl
def test_moignard15():
with warnings.catch_warnings():
Expand All @@ -56,19 +56,19 @@ def test_moignard15():
assert adata.shape == (3934, 42)


@pytest.mark.internet()
@pytest.mark.internet
def test_paul15():
sc.datasets.paul15()


@pytest.mark.internet()
@pytest.mark.internet
def test_pbmc3k():
adata = sc.datasets.pbmc3k()
assert adata.shape == (2700, 32738)
assert "CD8A" in adata.var_names


@pytest.mark.internet()
@pytest.mark.internet
def test_pbmc3k_processed():
with warnings.catch_warnings(record=True) as records:
adata = sc.datasets.pbmc3k_processed()
Expand All @@ -78,7 +78,7 @@ def test_pbmc3k_processed():
assert len(records) == 0


@pytest.mark.internet()
@pytest.mark.internet
def test_ebi_expression_atlas():
adata = sc.datasets.ebi_expression_atlas("E-MTAB-4888")
# The shape changes sometimes
Expand Down Expand Up @@ -111,7 +111,7 @@ def test_pbmc68k_reduced():
sc.datasets.pbmc68k_reduced()


@pytest.mark.internet()
@pytest.mark.internet
def test_visium_datasets():
"""Tests that reading/ downloading works and is does not have global effects."""
with pytest.warns(UserWarning, match=r"Variable names are not unique"):
Expand All @@ -121,7 +121,7 @@ def test_visium_datasets():
assert_adata_equal(hheart, hheart_again)


@pytest.mark.internet()
@pytest.mark.internet
def test_visium_datasets_dir_change(tmp_path: Path):
"""Test that changing the dataset dir doesn't break reading."""
with pytest.warns(UserWarning, match=r"Variable names are not unique"):
Expand All @@ -132,7 +132,7 @@ def test_visium_datasets_dir_change(tmp_path: Path):
assert_adata_equal(mbrain, mbrain_again)


@pytest.mark.internet()
@pytest.mark.internet
def test_visium_datasets_images():
"""Test that image download works and is does not have global effects."""

Expand Down
2 changes: 1 addition & 1 deletion tests/test_embedding_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def adata():
return adata


@pytest.fixture()
@pytest.fixture
def fixture_request(request):
"""Returns a Request object.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def transpose_adata(adata: AnnData, *, expect_duplicates: bool = False) -> AnnDa
)


@pytest.fixture()
@pytest.fixture
def adata():
"""
adata.X is np.ones((2, 2))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_highly_variable_genes.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def adata_sess() -> AnnData:
return adata


@pytest.fixture()
@pytest.fixture
def adata(adata_sess: AnnData) -> AnnData:
return adata_sess.copy()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
T = np.array([[2.0, 3.5, 4.0, 1.0, 4.7], [3.2, 2.0, 5.0, 5.0, 8.0]], dtype=np.float32)


@pytest.fixture()
@pytest.fixture
def adatas():
pbmc = pbmc68k_reduced()
n_split = 500
Expand Down
2 changes: 1 addition & 1 deletion tests/test_neighbors.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def get_neighbors() -> Neighbors:
return Neighbors(anndata_v0_8_constructor_compat(np.array(X)))


@pytest.fixture()
@pytest.fixture
def neigh() -> Neighbors:
return get_neighbors()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_neighbors_key_added.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
key = "test"


@pytest.fixture()
@pytest.fixture
def adata():
return sc.AnnData(pbmc68k_reduced().X)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_package_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
]


@pytest.fixture()
@pytest.fixture
def in_project_dir():
wd_orig = Path.cwd()
os.chdir(proj_dir)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_paga.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def pbmc_session():
return pbmc


@pytest.fixture()
@pytest.fixture
def pbmc(pbmc_session):
return pbmc_session.copy()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def zero_center(request: pytest.FixtureRequest):
return request.param


@pytest.fixture()
@pytest.fixture
def pca_params(
array_type, svd_solver_type: Literal[None, "valid", "invalid"], zero_center
):
Expand Down
6 changes: 3 additions & 3 deletions tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ def gene_symbols_adatas_session() -> tuple[AnnData, AnnData]:
return a, b


@pytest.fixture()
@pytest.fixture
def gene_symbols_adatas(gene_symbols_adatas_session) -> tuple[AnnData, AnnData]:
a, b = gene_symbols_adatas_session
return a.copy(), b.copy()
Expand Down Expand Up @@ -993,7 +993,7 @@ def pbmc_scatterplots_session() -> AnnData:
return pbmc


@pytest.fixture()
@pytest.fixture
def pbmc_scatterplots(pbmc_scatterplots_session) -> AnnData:
return pbmc_scatterplots_session.copy()

Expand Down Expand Up @@ -1352,7 +1352,7 @@ def test_scatter_no_basis_per_var(image_comparer):
save_and_compare_images("scatter_AAAGCCTGGCTAAC-1_vs_AAATTCGATGCACA-1")


@pytest.fixture()
@pytest.fixture
def pbmc_filtered() -> Callable[[], AnnData]:
pbmc = pbmc68k_reduced()
sc.pp.filter_genes(pbmc, min_cells=10)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_preprocessing_distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
pytestmark = [needs.zarr]


@pytest.fixture()
@pytest.fixture
@filter_oldformatwarning
def adata() -> AnnData:
a = read_zarr(input_file)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_qc_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
)


@pytest.fixture()
@pytest.fixture
def anndata():
a = np.random.binomial(100, 0.005, (1000, 1000))
adata = AnnData(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from testing.scanpy._pytest.marks import needs


@pytest.mark.internet()
@pytest.mark.internet
@needs.gprofiler
def test_enrich():
pbmc = pbmc68k_reduced()
Expand All @@ -33,7 +33,7 @@ def test_enrich():
assert "set2" in enrich_list["query"].unique()


@pytest.mark.internet()
@pytest.mark.internet
@needs.pybiomart
def test_mito_genes():
pbmc = pbmc68k_reduced()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_scrublet.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def scrub_small_sess() -> AnnData:
return adata


@pytest.fixture()
@pytest.fixture
def scrub_small(scrub_small_sess: AnnData):
return scrub_small_sess.copy()

Expand Down

0 comments on commit b619350

Please sign in to comment.