Skip to content

Commit

Permalink
Add in-memory flag to zarr_rechunk command line
Browse files Browse the repository at this point in the history
  • Loading branch information
blowekamp committed Nov 15, 2023
1 parent 3c1c9c7 commit 70f7f4b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pytools/zarr_rechunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,18 @@
default=False,
help="Use the preferred compressor when recompressing.",
)
@click.option(
"--in-memory", is_flag=True, show_default=True, default=False, help="Use in-memory zarr store when recompressing."
)
@click.version_option(__version__)
def main(input_zarr, log_level, chunk_size, recompress):
def main(input_zarr, log_level, chunk_size, recompress, in_memory):
logging.basicConfig(format="%(levelname)s: %(message)s", level=logging.getLevelName(log_level))

compressor = Blosc(cname="zstd", clevel=5, shuffle=Blosc.SHUFFLE)
z = HedwigZarrImages(input_zarr, read_only=False)

for k in z.get_series_keys():
z[k].rechunk(chunk_size, compressor=compressor if recompress else None)
z[k].rechunk(chunk_size, compressor=compressor if recompress else None, in_memory=in_memory)


if __name__ == "__main__":
Expand Down

0 comments on commit 70f7f4b

Please sign in to comment.