Skip to content

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.

3 participants