Skip to content

Commit 304dcbb

Browse files
committed
adapt add_anndatas change to tests
1 parent d841e13 commit 304dcbb

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def simple_collection(
114114
) -> tuple[DatasetCollection, ad.AnnData]:
115115
zarr_stores = sorted(f for f in adata_with_zarr_path_same_var_space[1].iterdir() if f.is_dir())
116116
output_path = Path(tmpdir_factory.mktemp("zarr_folder")) / "simple_fixture.zarr"
117-
collection = DatasetCollection(output_path).add_adatas(
117+
collection = DatasetCollection(output_path).add_anndatas(
118118
zarr_stores,
119119
zarr_sparse_chunk_size=10,
120120
zarr_sparse_shard_size=20,

tests/test_preshuffle.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_store_creation_warnings_with_different_keys(elem_name: Literal["obsm",
5151
adata_1.write_h5ad(path_1)
5252
adata_2.write_h5ad(path_2)
5353
with pytest.warns(UserWarning, match=rf"Found {elem_name} keys.* not present in all anndatas"):
54-
DatasetCollection(tmp_path / "collection.zarr").add_adatas(
54+
DatasetCollection(tmp_path / "collection.zarr").add_anndatas(
5555
[path_1, path_2],
5656
zarr_sparse_chunk_size=10,
5757
zarr_sparse_shard_size=20,
@@ -69,7 +69,7 @@ def test_store_creation_no_warnings_with_custom_load(tmp_path: Path):
6969
path_2 = tmp_path / "with_extra_key.h5ad"
7070
adata_1.write_h5ad(path_1)
7171
adata_2.write_h5ad(path_2)
72-
collection = DatasetCollection(tmp_path / "collection.zarr").add_adatas(
72+
collection = DatasetCollection(tmp_path / "collection.zarr").add_anndatas(
7373
[path_1, path_2],
7474
zarr_sparse_chunk_size=10,
7575
zarr_sparse_shard_size=20,
@@ -91,7 +91,7 @@ def test_store_creation_path_added_to_obs(tmp_path: Path):
9191
adata_2.write_h5ad(path_2)
9292
paths = [path_1, path_2]
9393
output_dir = tmp_path / "path_src_collection.zarr"
94-
collection = DatasetCollection(output_dir).add_adatas(
94+
collection = DatasetCollection(output_dir).add_anndatas(
9595
paths,
9696
zarr_sparse_chunk_size=10,
9797
zarr_sparse_shard_size=20,
@@ -120,7 +120,7 @@ def test_store_addition_different_keys(
120120
adata_orig.write_h5ad(orig_path)
121121
output_path = tmp_path / "zarr_store_addition_different_keys.zarr"
122122
collection = DatasetCollection(output_path)
123-
collection.add_adatas(
123+
collection.add_anndatas(
124124
[orig_path],
125125
zarr_sparse_chunk_size=10,
126126
zarr_sparse_shard_size=20,
@@ -136,7 +136,7 @@ def test_store_addition_different_keys(
136136
additional_path = tmp_path / "with_extra_key.h5ad"
137137
adata.write_h5ad(additional_path)
138138
with pytest.warns(UserWarning, match=rf"Found {elem_name} keys.* not present in all anndatas"):
139-
collection.add_adatas(
139+
collection.add_anndatas(
140140
[additional_path],
141141
load_adata=load_adata,
142142
zarr_sparse_chunk_size=10,
@@ -169,7 +169,7 @@ def test_store_creation_default(
169169
else r"Loading h5ad is currently not supported",
170170
):
171171
kwargs = {} if is_zarr else {"is_collection_h5ad": True}
172-
collection = DatasetCollection(output_path, **kwargs).add_adatas(
172+
collection = DatasetCollection(output_path, **kwargs).add_anndatas(
173173
[adata_with_h5_path_different_var_space[1] / f for f in h5_files if str(f).endswith(".h5ad")]
174174
)
175175
assert isinstance(
@@ -201,7 +201,7 @@ def test_store_creation(
201201
adata_with_h5_path_different_var_space[1].parent
202202
/ f"zarr_store_creation_test_{shuffle}_{'default_read' if load_adata is None else 'custom_read'}.zarr"
203203
)
204-
collection = DatasetCollection(output_path).add_adatas(
204+
collection = DatasetCollection(output_path).add_anndatas(
205205
[adata_with_h5_path_different_var_space[1] / f for f in h5_files if str(f).endswith(".h5ad")],
206206
var_subset=var_subset,
207207
zarr_sparse_chunk_size=10,
@@ -292,7 +292,7 @@ def test_mismatched_raw_concat(
292292
h5_files = sorted(adata_with_h5_path_different_var_space[1].iterdir())
293293
output_path = adata_with_h5_path_different_var_space[1].parent / "zarr_store_creation_test_heterogeneous.zarr"
294294
h5_paths = [adata_with_h5_path_different_var_space[1] / f for f in h5_files if str(f).endswith(".h5ad")]
295-
collection = DatasetCollection(output_path).add_adatas(
295+
collection = DatasetCollection(output_path).add_anndatas(
296296
h5_paths,
297297
zarr_sparse_chunk_size=10,
298298
zarr_sparse_shard_size=20,
@@ -337,7 +337,7 @@ def test_store_extension(
337337
additional = all_h5_paths[4:] # don't add everything to get a "different" var space
338338
# create new store
339339
collection = DatasetCollection(store_path)
340-
collection.add_adatas(
340+
collection.add_anndatas(
341341
original,
342342
zarr_sparse_chunk_size=10,
343343
zarr_sparse_shard_size=20,
@@ -348,7 +348,7 @@ def test_store_extension(
348348
shuffle=True,
349349
)
350350
# add h5ads to existing store
351-
collection.add_adatas(
351+
collection.add_anndatas(
352352
additional,
353353
load_adata=load_adata,
354354
zarr_sparse_chunk_size=10,
@@ -379,5 +379,5 @@ def test_empty(tmp_path: Path):
379379
assert collection.is_empty
380380
# Doesn't matter what errors as long as this function runs, but not to completion
381381
with pytest.raises(TypeError):
382-
collection.add_adatas()
382+
collection.add_anndatas()
383383
assert not (V1_ENCODING.items() <= g.attrs.items())

0 commit comments

Comments
 (0)