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

Indexing based on chunk's coordinates #596

Closed
skgbanga opened this issue Sep 1, 2020 · 2 comments
Closed

Indexing based on chunk's coordinates #596

skgbanga opened this issue Sep 1, 2020 · 2 comments

Comments

@skgbanga
Copy link

skgbanga commented Sep 1, 2020

Hello,

This came up in the issue #595 when we wanted to write to a zarr file in chunks to best use gcs backend.
The code that I wrote looked like this:

            ...
            start = (num_chunks - 1) * chunk_size
            end = num_chunks * chunk_size
            z[start:end, :] = np.array(rows)
            ...

I was looking in the docs (https://zarr.readthedocs.io/en/stable/tutorial.html#) to see if we can index based on chunk i.e. (hypothetical api)

z.chunk((3,4)) = np.array(rows)

where (3, 4) are the coordinates of the chunk that you want to write/read.

Does this suggestion make sense? Is there a better way to accomplish the above?

Thanks!

@joshmoore
Copy link
Member

See also #518

@skgbanga
Copy link
Author

skgbanga commented Sep 2, 2020

Ah, thanks @joshmoore. I will close this issue and +1 that thread.

@skgbanga skgbanga closed this as completed Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants