Skip to content

Commit

Permalink
Adding logging info when rechunking into memory.
Browse files Browse the repository at this point in the history
  • Loading branch information
blowekamp committed Nov 16, 2023
1 parent 70f7f4b commit 5e59e58
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pytools/HedwigZarrImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,14 @@ def rechunk(self, chunk_size: int, compressor=None, *, in_memory=False) -> None:

temp_arr = arr
if in_memory:
logger.info(f'Loading array: "{arr.name}" into memory...')
# optionally load the entire array uncompressed into memory
memory_group = zarr.group(store=zarr.MemoryStore(), overwrite=True)
zarr.copy(temp_arr, memory_group, name="temp", compressor=None)
temp_arr = memory_group["temp"]

logger.info(f'Rechunking array: "{arr.name} to disk"...')

# copy array to a temp zarr array on file
zarr.copy(
temp_arr,
Expand Down

0 comments on commit 5e59e58

Please sign in to comment.