Skip to content

Commit

Permalink
Backport PR #1419: [pre-commit.ci] pre-commit autoupdate (#1420)
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
meeseeksmachine and pre-commit-ci[bot] authored Mar 12, 2024
1 parent d250f04 commit aefc914
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 7 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.2.2
rev: v0.3.2
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
Expand Down
1 change: 1 addition & 0 deletions anndata/_core/merge.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Code for merging/ concatenating AnnData objects.
"""

from __future__ import annotations

import typing
Expand Down
1 change: 1 addition & 0 deletions anndata/_types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Defines some useful types for this library. Should probably be cleaned up before thinking about exporting.
"""

from __future__ import annotations

from typing import Union
Expand Down
1 change: 1 addition & 0 deletions anndata/tests/test_annot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test handling of values in `obs`/ `var`"""

from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions anndata/tests/test_awkward.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests related to awkward arrays"""

from __future__ import annotations

import warnings
Expand Down
6 changes: 3 additions & 3 deletions anndata/tests/test_concatenate.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,9 +873,9 @@ def test_nan_merge(axis, join_type, array_type):
with warnings.catch_warnings():
warnings.simplefilter("ignore", category=sparse.SparseEfficiencyWarning)
for _ in range(10):
arr_nan[
np.random.choice(arr.shape[0]), np.random.choice(arr.shape[1])
] = np.nan
arr_nan[np.random.choice(arr.shape[0]), np.random.choice(arr.shape[1])] = (
np.nan
)

_data = {"X": sparse.csr_matrix(adata_shape), mapping_attr: {"arr": arr_nan}}
orig1 = AnnData(**_data)
Expand Down
8 changes: 5 additions & 3 deletions anndata/tests/test_dask.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
For tests using dask
"""

from __future__ import annotations

import pandas as pd
Expand Down Expand Up @@ -107,9 +108,10 @@ def test_dask_distributed_write(adata, tmp_path, diskfmt):
pth = tmp_path / f"test_write.{diskfmt}"
g = as_group(pth, mode="w")

with dd.LocalCluster(
n_workers=1, threads_per_worker=1, processes=False
) as cluster, dd.Client(cluster):
with (
dd.LocalCluster(n_workers=1, threads_per_worker=1, processes=False) as cluster,
dd.Client(cluster),
):
M, N = adata.X.shape
adata.obsm["a"] = da.random.random((M, 10))
adata.obsm["b"] = da.random.random((M, 10))
Expand Down
1 change: 1 addition & 0 deletions anndata/tests/test_deprecations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This includes correct behaviour as well as throwing warnings.
"""

from __future__ import annotations

import warnings
Expand Down
1 change: 1 addition & 0 deletions anndata/tests/test_io_conversion.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""\
This file contains tests for conversion made during io.
"""

from __future__ import annotations

import h5py
Expand Down
1 change: 1 addition & 0 deletions anndata/tests/test_io_elementwise.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tests that each element in an anndata is written correctly
"""

from __future__ import annotations

import re
Expand Down
1 change: 1 addition & 0 deletions anndata/tests/test_x.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the attribute .X"""

from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions benchmarks/benchmarks/readwrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* io for backed objects
* Reading dense as sparse, writing sparse as dense
"""

from __future__ import annotations

import sys
Expand Down

0 comments on commit aefc914

Please sign in to comment.