Skip to content

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

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

Closed
jhamman opened this issue Oct 18, 2024 · 2 comments
Closed
Labels
bug Potential issues with the zarr-python library
Milestone

Comments

@jhamman
Copy link
Member

jhamman commented Oct 18, 2024

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

@jhamman jhamman added the bug Potential issues with the zarr-python library label Oct 18, 2024
@dstansby dstansby added this to the 3.0.0 milestone Dec 30, 2024
@normanrz
Copy link
Member

normanrz commented Jan 4, 2025

We should also add a serializer attribute.
Also, compressors, filters, serializer should be listed in Array.info instead of codecs.

@normanrz
Copy link
Member

normanrz commented Jan 7, 2025

Fixed in #2652

@normanrz normanrz closed this as completed Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Potential issues with the zarr-python library
Projects
None yet
Development

No branches or pull requests

3 participants