Skip to content

Error on array creation when the ChunkSize is greater than the array size itself #51

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

Merged
merged 3 commits into from
Apr 25, 2025

Conversation

abhibaruah
Copy link
Member

Fix for #30

Earlier, the error was added to zarrwrite only which was an oversight on my end.
Added this check to zarrcreate as well.

@abhibaruah abhibaruah requested review from krisfed and jm9176 April 18, 2025 19:07
Copy link
Member

@jm9176 jm9176 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks.

Copy link
Member

@krisfed krisfed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for delay, just saw this one!

Zarr.m Outdated
@@ -118,6 +118,10 @@ function create(obj, dtype, data_shape, chunk_shape, fillvalue, compression)
obj.TensorstoreDatatype = obj.TstoredtypeMap(dtype);
obj.ZarrDatatype = obj.ZarrdtypeMap(dtype);

if any(obj.ChunkSize > obj.DsetSize)
error("Chunk size cannot be greater than size of the data to be written.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be nice to review the errors with Matthew (if not already)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Planning to setup an error message catalog. Will run all the error messages by him then.

@abhibaruah abhibaruah merged commit d14dffb into main Apr 25, 2025
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

Successfully merging this pull request may close these issues.

3 participants