Skip to content

Commit

Permalink
Merge branch 'main' into create_cat_regressor
Browse files Browse the repository at this point in the history
  • Loading branch information
Intron7 authored Jan 23, 2025
2 parents 2e16c45 + 8ce811a commit 1b7d7e1
Show file tree
Hide file tree
Showing 152 changed files with 2,560 additions and 1,824 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

# Python build files
__pycache__/
/src/scanpy/_version.py
/ci/scanpy-min-deps.txt
/dist/
/*-env/
Expand All @@ -42,7 +41,6 @@ Thumbs.db

# IDEs and editors
/.idea/
/.vscode/

# asv benchmark files
/benchmarks/.asv
Expand Down
17 changes: 10 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
rev: v0.9.2
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
args: ["--fix"]
- id: ruff-format
types_or: [python, pyi, jupyter]
# The following can be removed once PLR0917 is out of preview
- name: ruff preview rules
id: ruff
types_or: [python, pyi, jupyter]
args: ["--preview", "--select=PLR0917"]
- repo: https://github.com/flying-sheep/bibfmt
rev: v4.3.0
Expand All @@ -19,6 +16,15 @@ repos:
args:
- --sort-by-bibkey
- --drop=abstract
- repo: https://github.com/biomejs/pre-commit
rev: v0.6.1
hooks:
- id: biome-format
additional_dependencies: ["@biomejs/[email protected]"]
- repo: https://github.com/ComPWA/taplo-pre-commit
rev: v0.9.3
hooks:
- id: taplo-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
Expand All @@ -34,6 +40,3 @@ repos:
- id: detect-private-key
- id: no-commit-to-branch
args: ["--branch=main"]

ci:
autofix_prs: false
5 changes: 5 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[formatting]
array_auto_collapse = false
column_width = 120
compact_arrays = false
indent_string = ' '
26 changes: 26 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Build Documentation",
"type": "debugpy",
"request": "launch",
"module": "sphinx",
"args": ["-M", "html", ".", "_build"],
"cwd": "${workspaceFolder}/docs",
"console": "internalConsole",
"justMyCode": false,
},
{
"name": "Python: Debug Test",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"purpose": ["debug-test"],
"console": "internalConsole",
"justMyCode": false,
"env": { "PYTEST_ADDOPTS": "--color=yes" },
"presentation": { "hidden": true },
},
],
}
22 changes: 22 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"[python][toml][json][jsonc]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit",
"source.fixAll": "explicit",
},
},
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
},
"[toml]": {
"editor.defaultFormatter": "tamasfe.even-better-toml",
},
"[json][jsonc]": {
"editor.defaultFormatter": "biomejs.biome",
},
"python.analysis.typeCheckingMode": "basic",
"python.testing.pytestArgs": ["-vv", "--color=yes"],
"python.testing.pytestEnabled": true,
"python.terminal.activateEnvironment": true,
}
2 changes: 1 addition & 1 deletion benchmarks/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"natsort": [""],
"pandas": [""],
"memory_profiler": [""],
"zarr": [""],
"zarr": ["2.18.4"],
"pytest": [""],
"scanpy": [""],
"python-igraph": [""],
Expand Down
21 changes: 21 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"formatter": {
"indentStyle": "space",
"indentWidth": 4,
},
"overrides": [
{
"include": ["./.vscode/*.json", "**/*.jsonc", "**/asv.conf.json"],
"json": {
"formatter": {
"trailingCommas": "all",
},
"parser": {
"allowComments": true,
"allowTrailingCommas": true,
},
},
},
],
}
4 changes: 3 additions & 1 deletion ci/scripts/min-deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def extract_min_deps(

# If we are referring to other optional dependency lists, resolve them
if req.name == project_name:
assert req.extras, f"Project included itself as dependency, without specifying extras: {req}"
assert req.extras, (
f"Project included itself as dependency, without specifying extras: {req}"
)
for extra in req.extras:
extra_deps = pyproject["project"]["optional-dependencies"][extra]
dependencies += map(Requirement, extra_deps)
Expand Down
6 changes: 5 additions & 1 deletion ci/scripts/towncrier_automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ def main(argv: Sequence[str] | None = None) -> None:
f"--base={base_branch}",
f"--title={pr_title}",
f"--body={pr_description}",
*(["--label=no milestone"] if base_branch == "main" else []),
*(
["--label=no milestone", "--label=Development Process 🚀"]
if base_branch == "main"
else []
),
*(["--dry-run"] if args.dry_run else []),
],
check=True,
Expand Down
1 change: 1 addition & 0 deletions docs/api/deprecated.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
pp.filter_genes_dispersion
pp.normalize_per_cell
pp.subsample
```
4 changes: 2 additions & 2 deletions docs/api/preprocessing.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ For visual quality control, see {func}`~scanpy.pl.highest_expr_genes` and
pp.normalize_total
pp.regress_out
pp.scale
pp.subsample
pp.sample
pp.downsample_counts
```

Expand All @@ -49,7 +49,7 @@ For visual quality control, see {func}`~scanpy.pl.highest_expr_genes` and

### Batch effect correction

Also see [Data integration]. Note that a simple batch correction method is available via {func}`pp.regress_out`. Checkout {mod}`scanpy.external` for more.
Also see {ref}`data-integration`. Note that a simple batch correction method is available via {func}`pp.regress_out`. Checkout {mod}`scanpy.external` for more.

```{eval-rst}
.. autosummary::
Expand Down
2 changes: 2 additions & 0 deletions docs/api/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ Compute densities on embeddings.
tl.paga
```

(data-integration)=

### Data integration

```{eval-rst}
Expand Down
5 changes: 2 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@
rapids_singlecell=("https://rapids-singlecell.readthedocs.io/en/latest/", None),
scipy=("https://docs.scipy.org/doc/scipy/", None),
seaborn=("https://seaborn.pydata.org/", None),
session_info2=("https://session-info2.readthedocs.io/en/stable/", None),
squidpy=("https://squidpy.readthedocs.io/en/stable/", None),
sklearn=("https://scikit-learn.org/stable/", None),
)

Expand Down Expand Up @@ -225,9 +227,6 @@ def setup(app: Sphinx):
("py:class", "scanpy._utils.Empty"),
("py:class", "numpy.random.mtrand.RandomState"),
("py:class", "scanpy.neighbors._types.KnnTransformerLike"),
# Will work once scipy 1.8 is released
("py:class", "scipy.sparse.base.spmatrix"),
("py:class", "scipy.sparse.csr.csr_matrix"),
]

# Options for plot examples
Expand Down
19 changes: 11 additions & 8 deletions docs/contributors.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# Contributors

[anndata graph](https://github.com/scverse/anndata/graphs/contributors>) | [scanpy graph](https://github.com/scverse/scanpy/graphs/contributors)| ☀ = maintainer

## Current developers

- [Isaac Virshup](https://github.com/ivirshup), lead developer since 2019 ☀
- [Gökcen Eraslan](https://twitter.com/gokcen), developer, diverse contributions ☀
- [Sergei Rybakov](https://github.com/Koncopd), developer, diverse contributions ☀
- [Fidel Ramirez](https://github.com/fidelram) developer, plotting ☀
- [Giovanni Palla](https://twitter.com/g_palla1), developer, spatial data
- [Malte Luecken](https://twitter.com/MDLuecken), developer, community & forum
- [Philipp Angerer](https://github.com/flying-sheep), lead developer since 2023, software quality, initial anndata conception ☀
- [Ilan Gold](https://github.com/ilan-gold), developer, Dask ☀
- [Severin Dicks](https://github.com/SeverinDicks), developer, performance ☀
- [Lukas Heumos](https://twitter.com/LukasHeumos), developer, diverse contributions
- [Philipp Angerer](https://github.com/flying-sheep), developer, software quality, initial anndata conception ☀

## Other roles

- [Isaac Virshup](https://github.com/ivirshup), lead developer 2019-2023
- [Alex Wolf](https://twitter.com/falexwolf): lead developer 2016-2019, initial anndata & scanpy conception
- [Fabian Theis](https://twitter.com/fabian_theis) & lab: enabling guidance, support and environment

## Former developers

- Tom White: developer 2018-2019, distributed computing
- [Tom White](https://github.com/tomwhite): developer 2018-2019, distributed computing
- [Gökcen Eraslan](https://twitter.com/gokcen), developer, diverse contributions
- [Sergei Rybakov](https://github.com/Koncopd), developer, diverse contributions
- [Fidel Ramirez](https://github.com/fidelram) developer, plotting
- [Giovanni Palla](https://twitter.com/g_palla1), developer, spatial data
- [Malte Luecken](https://twitter.com/MDLuecken), developer, community & forum
1 change: 1 addition & 0 deletions docs/dev/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
5. {ref}`Make sure all tests are passing <tests>`
6. {ref}`Build and visually check any changed documentation <building-the-docs>`
7. {ref}`Open a PR back to the main repository <open-a-pr>`
8. {ref}`Add a release note to your PR <adding-to-the-docs>`

## Code style

Expand Down
4 changes: 3 additions & 1 deletion docs/dev/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ Sometimes these caches are not invalidated when you've updated the docs.
If docs are not updating the way you expect, first try "force reloading" your browser page – e.g. reload the page without using the cache.
Next, if problems persist, clear the sphinx cache (`hatch run docs:clean`) and try building them again.

(adding-to-the-docs)=

## Adding to the docs

For any user-visible changes, please make sure a note has been added to the release notes using [`hatch run towncrier:create`][towncrier create].
We recommend waiting on this until your PR is close to done since this can often causes merge conflicts.
When asked for “Issue number (`+` if none)”, enter the *PR number* instead.

Once you've added a new function to the documentation, you'll need to make sure there is a link somewhere in the documentation site pointing to it.
This should be added to `docs/api.md` under a relevant heading.
Expand Down
3 changes: 2 additions & 1 deletion docs/extensions/param_police.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def show_param_warnings(app, exception):
line,
)
if param_warnings:
raise RuntimeError("Encountered text parameter type. Use annotations.")
msg = "Encountered text parameter type. Use annotations."
raise RuntimeError(msg)


def setup(app: Sphinx):
Expand Down
38 changes: 38 additions & 0 deletions docs/release-notes/1.11.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
(v1.11.0)=
### 1.11.0rc1 {small}`2024-12-20`

### Features

- {func}`~scanpy.pp.sample` supports both upsampling and downsampling of observations and variables. {func}`~scanpy.pp.subsample` is now deprecated. {smaller}`G Eraslan & P Angerer` ({pr}`943`)
- Add `layer` argument to {func}`scanpy.tl.score_genes` and {func}`scanpy.tl.score_genes_cell_cycle` {smaller}`L Zappia` ({pr}`2921`)
- Prevent `raw` conflict with `layer` in {func}`~scanpy.tl.score_genes` {smaller}`S Dicks` ({pr}`3155`)
- Add support for `median` as an aggregation function to {func}`~scanpy.get.aggregate`. This allows for median-based aggregation of data (e.g., pseudobulk), complementing existing methods like mean- and sum-based aggregation {smaller}`M Dehkordi (Farhad)` ({pr}`3180`)
- Add `key_added` argument to {func}`~scanpy.pp.pca`, {func}`~scanpy.tl.tsne` and {func}`~scanpy.tl.umap` {smaller}`P Angerer` ({pr}`3184`)
- Support running {func}`scanpy.pp.pca` on sparse Dask arrays with the `'covariance_eigh'` solver {smaller}`P Angerer` ({pr}`3263`)
- Use upstreamed {class}`~sklearn.decomposition.PCA` implementation for {class}`~scipy.sparse.csr_array` and {class}`~scipy.sparse.csr_matrix` (see scikit-learn {ref}`sklearn:changes_1_4`) {smaller}`P Angerer` ({pr}`3267`)
- Add explicit support to {func}`scanpy.pp.pca` for `svd_solver='covariance_eigh'` {smaller}`P Angerer` ({pr}`3296`)
- Add support for {class}`dask.array.Array` to {func}`scanpy.pp.calculate_qc_metrics` {smaller}`I Gold` ({pr}`3307`)
- Support `layer` parameter in {func}`scanpy.pl.highest_expr_genes` {smaller}`P Angerer` ({pr}`3324`)
- Run numba functions single-threaded when called from inside of a {class}`~multiprocessing.pool.ThreadPool` {smaller}`P Angerer` ({pr}`3335`)
- Switch {func}`~scanpy.logging.print_header` and {func}`~scanpy.logging.print_versions` to {mod}`session_info2` {smaller}`P Angerer` ({pr}`3384`)
- Add sampling probabilities/mask parameter `p` to {func}`~scanpy.pp.sample` {smaller}`P Angerer` ({pr}`3410`)

### Performance

- Speed up {func}`~scanpy.pp.regress_out` {smaller}`P Ashish, P Angerer & S Dicks` ({pr}`3284`)

### Documentation

- Improve {func}`~scanpy.external.pp.harmony_integrate` docs {smaller}`D Kühl` ({pr}`3362`)
- Raise {exc}`FutureWarning` when calling deprecated {mod}`scanpy.pp` functions {smaller}`P Angerer` ({pr}`3380`)
- | Deprecate … | in favor of … |
| --- | --- |
| {func}`scanpy.read_visium` | {func}`squidpy.read.visium` |
| {func}`scanpy.datasets.visium_sge` | {func}`squidpy.datasets.visium` |
| {func}`scanpy.pl.spatial` | {func}`squidpy.pl.spatial_scatter` |

{smaller}`P Angerer` ({pr}`3407`)

### Bug fixes

- Upper-bound {mod}`sklearn` `<1.6.0` due to {issue}`dask/dask-ml#1002` {smaller}`Ilan Gold` ({pr}`3393`)
2 changes: 1 addition & 1 deletion docs/release-notes/1.5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The `1.5.0` release adds a lot of new functionality, much of which takes advanta

#### Spatial data support

- Basic analysis {doc}`/tutorials/spatial/basic-analysis` and integration with single cell data {doc}`/tutorials/spatial/integration-scanorama` {smaller}`G Palla`
- Tutorials for basic analysis and integration with single cell data {smaller}`G Palla`
- {func}`~scanpy.read_visium` read 10x Visium data {pr}`1034` {smaller}`G Palla, P Angerer, I Virshup`
- {func}`~scanpy.datasets.visium_sge` load Visium data directly from 10x Genomics {pr}`1013` {smaller}`M Mirkazemi, G Palla, P Angerer`
- {func}`~scanpy.pl.spatial` plot spatial data {pr}`1012` {smaller}`G Palla, P Angerer`
Expand Down
1 change: 0 additions & 1 deletion docs/release-notes/2921.feature.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/release-notes/3155.feature.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/release-notes/3180.feature.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/release-notes/3184.feature.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/release-notes/3263.feature.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/release-notes/3267.feature.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/release-notes/3284.performance.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/release-notes/3296.feature.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/release-notes/3307.feature.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/release-notes/3324.feature.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/release-notes/3335.feature.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/release-notes/3362.doc.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/release-notes/3380.bugfix.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/release-notes/3393.bugfix.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/release-notes/3418.doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix reference in {mod}`scanpy.pp` page {smaller}`D Kazemi`
1 change: 1 addition & 0 deletions docs/release-notes/3426.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix {func}`~scanpy.tl.rank_genes_groups` compatibility with data >10M cells {smaller}`P Angerer`
1 change: 1 addition & 0 deletions docs/release-notes/3428.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix {func}`scanpy.pl.rank_genes_groups`’s `ax` parameter {smaller}`P Angerer`
1 change: 1 addition & 0 deletions docs/release-notes/3441.dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix version number inference in development environments (CI and local) {smaller}`P Angerer`
Loading

0 comments on commit 1b7d7e1

Please sign in to comment.