zarr-python icon indicating copy to clipboard operation
zarr-python copied to clipboard

Expose chunk and/or slice information (byte offset and size) to the API and make it available to the user

Open valeriupredoi opened this issue 2 years ago • 3 comments

Hey guys, first off apologies if this issue may be a duplicate of another (I did a cursory check and didn't really find any to fit the bill proper), and also if the issue should live in a Discussions item or elsewhere, feel free to move it :smiley:

I was wondering if we can have some convenience functionality part of the API for the user to be able to extract information about chunks and/or arbitrary slices (slices to be defined by the user), namely offset and size, and maybe position expressed in tuples of Python slices for chunks. I have written a small script that does that both for HDF5/h5py datasets (they have a nifty little function called get_chunk_info() but HDF5 slices get converted to ndarrays right at slice point, so they lose the info on offsets and sizes), and for Zarr chunks and slices here, so if you think this is useful and it's not implemented anywhere I don't know of (sorry, am still relatively new to Zarr), I'd be happy to help! For slice info I use the PartialChunkIterator class that appears to do get me the info I need, namely slices' offset and sizes (in uncompressed sizes).

At any rate, many thanks for your awesome work developing Zarr, and keep up the great work! :beer:

attn: @bnlawrence @davidhassell

valeriupredoi avatar Aug 24 '22 16:08 valeriupredoi

@valeriupredoi I would like to work under this issue.Kindly assign me

h20200051 avatar Sep 12 '22 07:09 h20200051

Thanks for taking this up @h20200051. Let me know if you need any help with this.

MSanKeys963 avatar Sep 12 '22 10:09 MSanKeys963

cheers for the initiative @h20200051 :beer: I am not a Zarr dev so I can't assign contributors, but I see you already got assigned :+1: Let me know how I can help, should anything be needed :rocket:

valeriupredoi avatar Sep 12 '22 10:09 valeriupredoi