Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
5 changes: 3 additions & 2 deletions docs/usage-principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
16 changes: 12 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading