Skip to content

Missing info regarding default compression behavior #45

Closed
@jm9176

Description

@jm9176

In MATLAB, no compression is applied if a user uses a default syntax, e.g. zarrcreate('prt_grp/arr1',[10 10]). However, if I create a zarr array using Python and Zarr library then it uses blosc compression by default. So, there seems to be some difference in default behavior between MATLAB and Python workflow.

So, it would be helpful to clarify this behavior or related differences.

**Python code**
# Create Zarr v2 array
import zarr
import numpy as np
store = zarr.DirectoryStore('prt_grp')
group = zarr.group(store=store,overwrite=True)
group.attrs['group_description'] = 'This is a sample Zarr group'
group.attrs['group_level'] = 1
array = group.create_dataset('arr_1',shape=(20,25),dtype=np.float32,chunks=(2,5),fillvalue=-9)
array.attrs['array_description'] = 'This is a sample Zarr array'
array.attrs['array_type'] = 'double'
array.attrs['array_level'] = 1
array[:] = np.random.rand(20,25)


**zarrinfo output from MATLAB**
>> info = zarrinfo('prt_grp/arr_1');
>> info.compressor

ans = 

  struct with fields:

    blocksize: 0
       clevel: 5
        cname: 'lz4'
           id: 'blosc'
      shuffle: 1


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions