Skip to content

[v3] AttributeError: 'Array' object has no attribute 'compressor' (or 'filter') #2405

Closed
@jhamman

Description

@jhamman

Zarr version

3.0.0.beta

Numcodecs version

0.13

Python Version

3.11

Operating System

Mac

Installation

pip

Description

Zarr-Python 2 exposed compressor and filters as attributes on the Array class. We should do the same for 3.0 for arrays with zarr_format=2 and raise a NotImplementedError for zarr_format=3.

Its probably best that we also mark these as deprecated, encouraging folks to use array.metadata directly.

Steps to reproduce

In [14]: arr = zarr.zeros(shape=10)

In [15]: arr.compressor
--------------------------------------------------------------------------
AttributeError                           Traceback (most recent call last)
Cell In[15], line 1
----> 1 arr.compressor

AttributeError: 'Array' object has no attribute 'compressor'

In [16]: arr.filters
--------------------------------------------------------------------------
AttributeError                           Traceback (most recent call last)
Cell In[16], line 1
----> 1 arr.filters

AttributeError: 'Array' object has no attribute 'filters'

Additional output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPotential issues with the zarr-python library

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions