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

Allow blosc typesize undefined #17

Open
wants to merge 3 commits into
base: async
Choose a base branch
from

Conversation

brokkoli71
Copy link
Contributor

According to zarr v3 specs, the blosc parameter typesize does not need to be defined if the parameter shuffle is set to "noshuffle".
Currently, an error occurs on opening an array with typesize not defined:

 File "<cattrs generated structure zarrita.metadata.BloscCodecConfigurationMetadata>", line 5, in structure_BloscCodecConfigurationMetadata
     res['typesize'] = __c_structure_typesize(o['typesize'])
 KeyError: 'typesize'
 Structuring class BloscCodecConfigurationMetadata @ attribute typesize

This PR sets typesize=0 as default, which will set typesize internally to the byte count of the datatype in use

@normanrz
Copy link
Member

Should we add validation somewhere that typesize has to be set when shuffle != noshuffle? Should typesize be None if unset?

@brokkoli71
Copy link
Contributor Author

Do you mean the validation of the metadata read from the disk? Theoretically the metadata would be invalid if typesize is not provided. But in my understanding using typesize=0 and thus retrieving the byte count of the datatype of the array in use should cause no problem. What do you think?

I agree None might be better than 0

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.

2 participants