Skip to content

Commit

Permalink
Clean up test
Browse files Browse the repository at this point in the history
  • Loading branch information
dstansby committed Sep 5, 2024
1 parent 7d4cb15 commit 0b3ff84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/stack_to_chunk/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def add_full_res_data(
n_processes :
Number of parallel processes to use to read/write data.
start_z_idx :
z-index at which this stack of data starts. Can be useful to write
z-index at which this stack of input data starts. Can be useful to write
multiple slabs in parallel using a compute cluster where the job wants
to be split into many small individual Python processes.
Expand Down
12 changes: 7 additions & 5 deletions src/stack_to_chunk/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,18 @@ def test_parallel_copy(tmp_path: Path, arr: da.Array) -> None:
chunk_size=chunk_size,
compressor=compressor,
)
# Add first slab
group.add_full_res_data(
arr[:, :, :64],
n_processes=1,
start_z_idx=0,
)
# Add second slab
group.add_full_res_data(
arr[:, :, 64:],
n_processes=1,
start_z_idx=64,
)
with pytest.raises(
ValueError,
match=re.escape("start_z_idx (2) is not a multiple of chunk_size (64)"),
Expand All @@ -227,11 +234,6 @@ def test_parallel_copy(tmp_path: Path, arr: da.Array) -> None:
n_processes=1,
start_z_idx=2,
)
group.add_full_res_data(
arr[:, :, 64:],
n_processes=1,
start_z_idx=64,
)

check_full_res_copy(zarr_path, group, arr)

Expand Down

0 comments on commit 0b3ff84

Please sign in to comment.