Skip to content

Commit

Permalink
fix: unpacking using asterisk is not available in python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinchai committed Nov 12, 2024
1 parent b2390b4 commit 92c3a36
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions linc_convert/utils/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,12 +607,12 @@ def update_metadata(metadata: dict, shape: list[int]) -> dict:
slice(i*max_load, min((i+1)*max_load, n))
for i, n in zip(chunk_index, prev_shape)
]
dat = tsreader.with_transaction(txn)[*slicer].read().result()
dat = tsreader.with_transaction(txn)[tuple(slicer)].read().result()

# Discard the last voxel along odd dimensions
crop = [0 if x == 1 else x % 2 for x in dat.shape[-3:]]
slcr = [slice(-1) if x else slice(None) for x in crop]
dat = dat[Ellipsis, *slcr]
dat = dat[tuple([Ellipsis, *slcr])]

patch_shape = dat.shape[-3:]

Expand Down Expand Up @@ -643,7 +643,7 @@ def update_metadata(metadata: dict, shape: list[int]) -> dict:
slice(i*max_load//2, min((i+1)*max_load//2, n))
for i, n in zip(chunk_index, shape)
]
tswriter.with_transaction(txn)[*slicer] = dat
tswriter.with_transaction(txn)[tuple(slicer)] = dat

print("")

Expand Down

0 comments on commit 92c3a36

Please sign in to comment.