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

Unable to make a Zarr Array #2608

Open
me-her opened this issue Dec 31, 2024 · 0 comments
Open

Unable to make a Zarr Array #2608

me-her opened this issue Dec 31, 2024 · 0 comments
Labels
bug Potential issues with the zarr-python library V2 Affects the v2 branch

Comments

@me-her
Copy link

me-her commented Dec 31, 2024

Zarr version

v2.18.3

Numcodecs version

v0.13.1

Python Version

3.10

Operating System

Linux

Installation

uv pip install zarr

Description

Unable to create a zarr array with numpy array as data. I tried to use zarr_array = zarr.array(data = data). It errors out saying,
AttributeError: 'dict' object has no attribute 'encode'. Maybe we need to pass in the compressor as a dictionary.

Steps to reproduce

n [1]: import zarr

In [2]: import numpy as np

In [3]: data = np.ones([1,1])

In [4]: data
Out[4]: array([[1.]])

In [5]: zarr_array = zarr.array(data = data)


2393 # compress
2394 if self._compressor:
-> 2395 cdata = self._compressor.encode(chunk)
2396 else:
2397 cdata = chunk

AttributeError: 'dict' object has no attribute 'encode'

Additional output

Image
@me-her me-her added the bug Potential issues with the zarr-python library label Dec 31, 2024
@jhamman jhamman added the V2 Affects the v2 branch label Jan 4, 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 V2 Affects the v2 branch
Projects
None yet
Development

No branches or pull requests

2 participants