Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3] reimplement / develop Group.info and Array.info properties #2135

Closed
Tracked by #2412
jhamman opened this issue Aug 28, 2024 · 4 comments · Fixed by #2400
Closed
Tracked by #2412

[v3] reimplement / develop Group.info and Array.info properties #2135

jhamman opened this issue Aug 28, 2024 · 4 comments · Fixed by #2400
Labels
good-first-issue Good place to get started as a new contributor. help wanted Issue could use help from someone with familiarity on the topic
Milestone

Comments

@jhamman
Copy link
Member

jhamman commented Aug 28, 2024

Zarr Python 2 had nice info properties on the Group and Array classes. We haven't built these for v3 yet.

  >>> import zarr
  >>> z = zarr.zeros(1000000, chunks=100000, dtype='i4')
  >>> z.info
  Type               : zarr.core.Array
  Data type          : int32
  Shape              : (1000000,)
  Chunk shape        : (100000,)
  Order              : C
  Read-only          : False
  Compressor         : Blosc(cname='lz4', clevel=5, shuffle=SHUFFLE, blocksize=0)
  Store type         : zarr.storage.KVStore
  No. bytes          : 4000000 (3.8M)
  No. bytes stored   : 320
  Storage ratio      : 12500.0
  Chunks initialized : 0/10

Reference to stub in v3:

async def info(self) -> None:
raise NotImplementedError

@jhamman jhamman added help wanted Issue could use help from someone with familiarity on the topic good-first-issue Good place to get started as a new contributor. V3 labels Aug 28, 2024
@jhamman jhamman added this to the After 3.0.0 milestone Aug 28, 2024
@sanketverma1704 sanketverma1704 self-assigned this Aug 28, 2024
@sanketverma1704
Copy link
Member

Thanks for the issue, @jhamman. I'd like to work on this.

AFAIK we discussed, leaving out properties that require computation, i.e., the number of bytes, the number of bytes stored, the storage ratio, etc.

@jhamman jhamman moved this to Todo in Zarr-Python - 3.0 Aug 28, 2024
@jhamman
Copy link
Member Author

jhamman commented Aug 28, 2024

@MSanKeys963 - I think that is a great place to start. We could also make the trigger for computation something that you have to opt into. Like Array.info(compute=True) or something like that.

@TomAugspurger
Copy link
Contributor

I can take a shot at this quick.

@TomAugspurger
Copy link
Contributor

I'd like to keep .info as a properly, like it was in v2. I think we can include fields requiring computation in an info_full or info_complete method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue Good place to get started as a new contributor. help wanted Issue could use help from someone with familiarity on the topic
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants