Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
8143e07
WIP
flying-sheep Oct 9, 2024
2bfdd7a
make all test modules import
flying-sheep Oct 10, 2024
2d13618
some misc fixes
flying-sheep Oct 10, 2024
b8f91c0
Merge branch 'main' into x-layers-unification
flying-sheep Oct 25, 2024
f12f4d7
small fixes
flying-sheep Oct 25, 2024
95e8f1d
fix write_anndata
flying-sheep Oct 25, 2024
a6555f8
some more fixes
flying-sheep Oct 25, 2024
56252a8
Merge branch 'main' into x-layers-unification
flying-sheep Jul 15, 2025
77024ba
make setting X to None equivalent to deleting it
flying-sheep Jul 15, 2025
208b8bb
handle X from layers
flying-sheep Jul 15, 2025
fca1a87
simplify copy
flying-sheep Jul 15, 2025
5ac31c4
delegate transpose to layers
flying-sheep Jul 15, 2025
1d0151b
Merge branch 'main' into x-layers-unification
ilan-gold Aug 22, 2025
3756974
fix: most immutable setting situtations (#2095)
ilan-gold Aug 29, 2025
28436ec
make them falsy
flying-sheep Aug 29, 2025
08d2fcb
Merge branch 'main' into x-layers-unification
ilan-gold Feb 12, 2026
77d218d
fix: dont accidentally open backed mode
ilan-gold Feb 12, 2026
5c118e0
fix: remove expectant test
ilan-gold Feb 12, 2026
9342e91
fix: collection dtype checking
ilan-gold Feb 12, 2026
8513bde
fix: layers test
ilan-gold Feb 12, 2026
c9b096a
fix: copy changes
ilan-gold Feb 12, 2026
a41f725
fix: removal
ilan-gold Feb 12, 2026
c8d9683
fix: warn
ilan-gold Feb 12, 2026
9330978
maybe don't warn on deleting?
ilan-gold Feb 12, 2026
b2651e0
fix: del test
ilan-gold Feb 12, 2026
24f1684
fix: del yes!
ilan-gold Feb 12, 2026
0ee2a12
fix: correct conditoin
ilan-gold Feb 12, 2026
30d4474
Merge branch 'main' into x-layers-unification
ilan-gold Feb 12, 2026
5e7b8ad
Merge branch 'x-layers-unification' of github.com:scverse/anndata int…
ilan-gold Feb 12, 2026
1cdd856
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 12, 2026
579bede
Merge branch 'main' into x-layers-unification
ilan-gold Feb 25, 2026
0d187b4
fix: sizeof
ilan-gold Feb 26, 2026
4ea7847
fix: update view setting
ilan-gold Feb 26, 2026
4f97aaa
fix: copying X in setting None
ilan-gold Feb 26, 2026
ad93198
fix: virtualenv
ilan-gold Feb 26, 2026
7fd1b02
Merge branch 'main' into x-layers-unification
ilan-gold Mar 4, 2026
b595e91
Merge branch 'main' into x-layers-unification
ilan-gold Apr 27, 2026
5cd4b45
fix: iteration hadnling
ilan-gold Apr 27, 2026
81098fc
Merge branch 'main' into x-layers-unification
ilan-gold Apr 27, 2026
1f13860
fix: small fixes
ilan-gold Apr 27, 2026
03e58a2
fix: concat docs
ilan-gold Apr 27, 2026
2158825
fix: remove `_copy` condition
ilan-gold Apr 27, 2026
b7eea4e
fix: copy
ilan-gold Apr 27, 2026
c5bcb6b
fix: add `backed` hack for `layers` specifically
ilan-gold Apr 27, 2026
dfc8d52
fix: backed check
ilan-gold Apr 27, 2026
ec00345
fix: array api handling
ilan-gold Apr 27, 2026
7327ccb
fix: ok back out of that, needs to be even more explicit
ilan-gold Apr 27, 2026
38858fc
fix: `obsp` ellipsis
ilan-gold Apr 28, 2026
5ad2293
Merge branch 'main' into x-layers-unification
ilan-gold Apr 28, 2026
ecfdd8c
types
flying-sheep Apr 28, 2026
09f5e4c
double del
flying-sheep Apr 28, 2026
dd7722b
simpler is_none_backed
flying-sheep Apr 28, 2026
05364d0
style
flying-sheep Apr 28, 2026
691cac0
style
flying-sheep Apr 28, 2026
4e2e76d
style
flying-sheep Apr 28, 2026
233520c
resolve TODO
flying-sheep Apr 28, 2026
cb30a50
comment
flying-sheep Apr 28, 2026
49978e7
relnotes
flying-sheep Apr 28, 2026
64188b1
fix: add warning
ilan-gold May 5, 2026
d69e1e1
Merge branch 'main' into x-layers-unification
flying-sheep May 7, 2026
eab6a5d
relnote
flying-sheep May 7, 2026
3d8f4bd
test for warning
flying-sheep May 7, 2026
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
1 change: 1 addition & 0 deletions .github/workflows/test-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
needs: get-environments
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
env: ${{ fromJSON(needs.get-environments.outputs.envs) }}
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
Expand Down
7 changes: 7 additions & 0 deletions docs/concatenation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Let's start off with an example:
obsm: 'X_pca', 'X_umap'
varm: 'PCs'
obsp: ...
layers: None

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

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

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

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

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

`adatas` is now a list of datasets with disjoint sets of observations and a common set of variables.
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.
Expand All @@ -193,16 +197,19 @@ Taking a look at how this affects concatenation:
AnnData object with n_obs × n_vars = 640 × 30
obs: 'blobs'
obsm: 'X_pca', 'qc'
layers: None
>>> ad.concat(adatas, merge="same")
AnnData object with n_obs × n_vars = 640 × 30
obs: 'blobs'
obsm: 'X_pca', 'qc'
varm: 'PCs'
layers: None
>>> ad.concat(adatas, merge="unique")
AnnData object with n_obs × n_vars = 640 × 30
obs: 'blobs'
obsm: 'X_pca', 'qc'
varm: 'PCs', '0_qc', '1_qc', '2_qc', '3_qc', '4_qc'
layers: None

Note that comparisons are made after indices are aligned.
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"`.
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ def res(
("py:class", "anndata.acc.GenericAlias"),
("py:obj", "typing.R"),
("py:class", "_M"),
("py:class", "anndata.utils.Default"),
]

# -- Social cards ---------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/1707.breaking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove `dtype` argument from {class}`~anndata.AnnData` constructor. {user}`flying-sheep`
3 changes: 3 additions & 0 deletions docs/release-notes/1707.feat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Move {attr}`~anndata.AnnData.X` into {attr}`anndata.AnnData.layers` under the `None` key.
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`.
{user}`flying-sheep` & {user}`ilan-gold`
4 changes: 2 additions & 2 deletions src/anndata/_core/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
from anndata import AnnData


class ElementRef(NamedTuple):
class ElementRef[K: (str, str | None)](NamedTuple):
parent: AnnData
attrname: str
keys: tuple[str, ...] = ()
keys: tuple[K, ...] = ()

def __str__(self) -> str:
return f".{self.attrname}" + "".join(f"[{x!r}]" for x in self.keys)
Expand Down
Loading
Loading