diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a15929b99b..2985e3b156 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,18 +8,18 @@ repos: - --drop=abstract groups: [format] - repo: https://github.com/biomejs/pre-commit - rev: v2.5.10 + rev: v2.5.11 hooks: - id: biome-format groups: [format] exclude: ^\.cruft\.json$ # inconsistent indentation with cruft - file never to be modified manually. - repo: https://github.com/tox-dev/pyproject-fmt - rev: v2.28.1 + rev: v2.29.3 hooks: - id: pyproject-fmt groups: [format] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.16.4 + rev: v0.16.5 hooks: - id: ruff-check args: [--fix, --exit-non-zero-on-fix] @@ -49,7 +49,7 @@ repos: - id: no-commit-to-branch args: [--branch=main] - repo: https://github.com/zizmorcore/zizmor-pre-commit - rev: v1.29.0 + rev: v1.30.0 hooks: - id: zizmor args: [--no-progress, --fix] diff --git a/docs/usage-principles.md b/docs/usage-principles.md index d3c4dff647..457824dc8a 100644 --- a/docs/usage-principles.md +++ b/docs/usage-principles.md @@ -56,9 +56,10 @@ to initialize an {class}`~anndata.AnnData` object. Possibly add further annotati ```python import pandas as pd + anno = pd.read_csv(filename_sample_annotation) -adata.obs['cell_groups'] = anno['cell_groups'] # categorical annotation of type pandas.Categorical -adata.obs['time'] = anno['time'] # numerical annotation of type float +# annotations of types pandas.Categorical and float +adata.obs[["cell_groups", "time"]] = anno[["cell_groups", "time"]] # alternatively, you could also set the whole dataframe # adata.obs = anno ``` diff --git a/pyproject.toml b/pyproject.toml index 3183521eac..c5e98b8ac1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -226,10 +226,18 @@ lint.pylint.max-positional-args = 5 "pandas.api.types.is_categorical_dtype".msg = "Use isinstance(s.dtype, CategoricalDtype) instead" "pandas.value_counts".msg = "Use pd.Series(a).value_counts() instead" "pytest.importorskip".msg = "Use the “@needs” decorator/mark instead" -"scipy.sparse.csc_array".msg = "Use _compat.CSCBase or _compat.CSBase for typing/type checks and add `# noqa: TID251` when constructing" -"scipy.sparse.csc_matrix".msg = "Use _compat.CSCBase or _compat.CSBase for typing/type checks and add `# noqa: TID251` when constructing" -"scipy.sparse.csr_array".msg = "Use _compat.CSRBase or _compat.CSBase for typing/type checks and add `# noqa: TID251` when constructing" -"scipy.sparse.csr_matrix".msg = "Use _compat.CSRBase or _compat.CSBase for typing/type checks and add `# noqa: TID251` when constructing" +"scipy.sparse.csc_array".msg = """\ + Use _compat.CSCBase or _compat.CSBase for typing/type checks and add `# noqa: TID251` when constructing\ + """ +"scipy.sparse.csc_matrix".msg = """\ + Use _compat.CSCBase or _compat.CSBase for typing/type checks and add `# noqa: TID251` when constructing\ + """ +"scipy.sparse.csr_array".msg = """\ + Use _compat.CSRBase or _compat.CSBase for typing/type checks and add `# noqa: TID251` when constructing\ + """ +"scipy.sparse.csr_matrix".msg = """\ + Use _compat.CSRBase or _compat.CSBase for typing/type checks and add `# noqa: TID251` when constructing\ + """ "scipy.sparse.issparse".msg = "Use isinstance(_, _compat.CSBase) or isinstance(_, _compat.SpBase) instead" "scipy.sparse.sparray".msg = "Use _compat.SpBase instead" "scipy.sparse.spmatrix".msg = "Use _compat.SpBase instead"