1717 from collections .abc import Callable , Collection
1818 from typing import Literal
1919
20- from anndata .acc import AdRef
20+ from anndata .acc import AdRef , MapAcc
2121
2222
2323type AdRefSer = Sequence [str | int | None ]
3636 (A .layers ["a" ]["cell-77" , :], ["layers" , "a" , "cell-77" , None ]),
3737 (A .obsm ["umap" ][0 ], ["obsm" , "umap" , 0 ]),
3838 (A .obsm ["umap" ][1 ], ["obsm" , "umap" , 1 ]),
39+ (A .varp ["cons" ][:, :], ["varp" , "cons" , None , None ]),
3940 (A .varp ["cons" ]["gene-46" , :], ["varp" , "cons" , "gene-46" , None ]),
4041 (A .varp ["cons" ][:, "gene-46" ], ["varp" , "cons" , None , "gene-46" ]),
4142]
@@ -216,7 +217,7 @@ def test_special[C](
216217
217218
218219@pytest .mark .parametrize (
219- "ad_ref " ,
220+ "ref_or_acc " ,
220221 [
221222 * (p [0 ] for p in PATHS ),
222223 A .X ,
@@ -230,12 +231,12 @@ def test_special[C](
230231 ],
231232 ids = str ,
232233)
233- def test_in (adata : AnnData , ad_ref : AdRef ) -> None :
234- assert ad_ref in adata
234+ def test_in (adata : AnnData , ref_or_acc : AdRef | MapAcc ) -> None :
235+ assert ref_or_acc in adata
235236
236237
237238@pytest .mark .parametrize (
238- "ad_ref " ,
239+ "ref_or_acc " ,
239240 [
240241 A .layers ["a" ]["gene-0" , :], # not an obs name
241242 A .layers ["a" ][:, "cell-3" ], # not a var name
@@ -250,8 +251,8 @@ def test_in(adata: AnnData, ad_ref: AdRef) -> None:
250251 ],
251252 ids = str ,
252253)
253- def test_not_in (adata : AnnData , ad_ref : AdRef ) -> None :
254- assert ad_ref not in adata
254+ def test_not_in (adata : AnnData , ref_or_acc : AdRef | MapAcc ) -> None :
255+ assert ref_or_acc not in adata
255256
256257
257258def test_not_in_empty (ad_ref : AdRef ) -> None :
0 commit comments