Skip to content

Commit f9c62cb

Browse files
committed
Merge remote-tracking branch 'origin/main' into html_rep
# Conflicts: # .vscode/settings.json # src/anndata/_settings.pyi # tests/test_repr.py
2 parents e486c3c + 4334c8f commit f9c62cb

53 files changed

Lines changed: 602 additions & 424 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test-cpu.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
needs: get-environments
4242
runs-on: ubuntu-latest
4343
strategy:
44+
fail-fast: false
4445
matrix:
4546
env: ${{ fromJSON(needs.get-environments.outputs.envs) }}
4647
io_mark: ["zarr_io", "not zarr_io", "dask_distributed"] # dask_distributed should not be run with -n auto as it uses a client with processes

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313
id: ruff
1414
args: ["--preview", "--select=PLR0917"]
1515
- repo: https://github.com/biomejs/pre-commit
16-
rev: v2.4.13
16+
rev: v2.4.15
1717
hooks:
1818
- id: biome-format
1919
- repo: https://github.com/ComPWA/taplo-pre-commit

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
],
2626
"python.terminal.activateEnvironment": true,
2727
"python.analysis.include": ["src/**/*", "ci/scripts/**/*", "tests/**/*"],
28-
"python-envs.defaultEnvManager": "ms-python.python:venv",
29-
"python-envs.defaultPackageManager": "ms-python.python:pip",
28+
"python-envs.defaultEnvManager": "pypa.hatch:hatch",
29+
"python-envs.defaultPackageManager": "pypa.hatch:hatch",
3030
}

benchmarks/benchmarks/dataset2d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def setup_cache(self):
3434
for k, v in array_types.items():
3535
for store in [
3636
h5py.File(f"data_{k}.h5ad", mode="w"),
37-
zarr.open(f"data_{k}.zarr", mode="w", zarr_version=2),
37+
zarr.open(f"data_{k}.zarr", mode="w", zarr_format=2),
3838
]:
3939
df = pd.DataFrame({"a": v}, index=[f"cell{i}" for i in range(n_obs)])
4040
if writing_string_array_on_disk := (
@@ -48,7 +48,7 @@ def setup_cache(self):
4848
assert store["df"]["a"].attrs["encoding-type"] == "string-array"
4949
for store in [
5050
h5py.File("data_all.h5ad", mode="w"),
51-
zarr.open("data_all.zarr", mode="w", zarr_version=2),
51+
zarr.open("data_all.zarr", mode="w", zarr_format=2),
5252
]:
5353
df = pd.DataFrame(array_types, index=[f"cell{i}" for i in range(n_obs)])
5454
# write a string array by triggering:

docs/concatenation.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Let's start off with an example:
3030
obsm: 'X_pca', 'X_umap'
3131
varm: 'PCs'
3232
obsp: ...
33+
layers: None
3334

3435
If we split this object up by clusters of observations, then stack those subsets we'll obtain the same values – just ordered differently.
3536

@@ -42,6 +43,7 @@ If we split this object up by clusters of observations, then stack those subsets
4243
var: 'n_counts', 'means', 'dispersions', 'dispersions_norm', 'highly_variable'
4344
obsm: 'X_pca', 'X_umap'
4445
varm: 'PCs'
46+
layers: None
4547

4648
Note that we concatenated along the observations by default, and that most elements aligned to the observations were concatenated as well.
4749
A notable exception is :attr:`~anndata.AnnData.obsp`, which can be re-enabled with the `pairwise` keyword argument.
@@ -168,6 +170,7 @@ First, our example case:
168170
uns: 'pca'
169171
obsm: 'X_pca'
170172
varm: 'PCs'
173+
layers: None
171174

172175
Now we will split this object by the categorical `"blobs"` and recombine it to illustrate different merge strategies.
173176

@@ -184,6 +187,7 @@ Now we will split this object by the categorical `"blobs"` and recombine it to i
184187
uns: 'pca'
185188
obsm: 'X_pca', 'qc'
186189
varm: 'PCs', '0_qc'
190+
layers: None
187191

188192
`adatas` is now a list of datasets with disjoint sets of observations and a common set of variables.
189193
Each object has had QC metrics computed, with observation-wise metrics stored under `"qc"` in `.obsm`, and variable-wise metrics stored with a unique key for each subset.
@@ -193,16 +197,19 @@ Taking a look at how this affects concatenation:
193197
AnnData object with n_obs × n_vars = 640 × 30
194198
obs: 'blobs'
195199
obsm: 'X_pca', 'qc'
200+
layers: None
196201
>>> ad.concat(adatas, merge="same")
197202
AnnData object with n_obs × n_vars = 640 × 30
198203
obs: 'blobs'
199204
obsm: 'X_pca', 'qc'
200205
varm: 'PCs'
206+
layers: None
201207
>>> ad.concat(adatas, merge="unique")
202208
AnnData object with n_obs × n_vars = 640 × 30
203209
obs: 'blobs'
204210
obsm: 'X_pca', 'qc'
205211
varm: 'PCs', '0_qc', '1_qc', '2_qc', '3_qc', '4_qc'
212+
layers: None
206213

207214
Note that comparisons are made after indices are aligned.
208215
That is, if the objects only share a subset of indices on the alternative axis, it's only required that values for those indices match when using a strategy like `"same"`.

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def res(
181181
("py:class", "anndata.acc.GenericAlias"),
182182
("py:obj", "typing.R"),
183183
("py:class", "_M"),
184+
("py:class", "anndata.utils.Default"),
184185
]
185186

186187
# -- Social cards ---------------------------------------------------------

docs/release-notes/0.12.11.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
(v0.12.11)=
2+
### 0.12.11 {small}`2026-04-21`
3+
4+
#### Bug fixes
5+
6+
- {attr}`anndata.settings.zarr_write_format` and {attr}`anndata.settings.auto_shard_zarr_v3` can now be set together {user}`ilan-gold` ({pr}`2342`)
7+
- Check `Raw` length on creation and fix associated `.adata` in `Raw` slicing {user}`P Angerer` ({pr}`2351`)
8+
- Ensure the index name along `obs` and `var` are not lost when reading/writing to disk after reading with {func}`~anndata.experimental.read_lazy` {user}`ilan-gold` ({pr}`2358`)
9+
10+
#### Performance
11+
12+
- Accelerate outer joins on dask-sparse matrices with unchunked minor axes in {func}`anndata.concat` {user}`ilan-gold` ({pr}`2395`)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove `dtype` argument from {class}`~anndata.AnnData` constructor. {user}`flying-sheep`

docs/release-notes/1707.feat.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Move {attr}`~anndata.AnnData.X` into {attr}`anndata.AnnData.layers` under the `None` key.
2+
As result, `layers: X` shows up in `AnnData`’s text representation, `None` appears in `.layers.items()`/`.keys()`, {func}`~anndata.concat` now works when some `AnnData`s have no `X`.
3+
{user}`flying-sheep` & {user}`ilan-gold`

docs/release-notes/2342.fix.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)