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

zarr allows bad fill values #2205

Closed
dcherian opened this issue Sep 18, 2024 · 1 comment
Closed

zarr allows bad fill values #2205

dcherian opened this issue Sep 18, 2024 · 1 comment
Labels
bug Potential issues with the zarr-python library

Comments

@dcherian
Copy link
Contributor

Zarr version

v3 main

Numcodecs version

?

Python Version

?

Operating System

?

Installation

?

Description

Seems to accept -1 fill value for uint32 arrays.

Steps to reproduce

def test_bad_fill_value():
    import zarr
    import numpy as np

    store = zarr.store.MemoryStore({}, mode="w")
    group = zarr.group(store=store, overwrite=True)

    zarray = group.create_array(
        name="foo",
        shape=(2,),
        fill_value=-1,
        chunk_shape=(1,),
        dtype=np.uint32,
        exists_ok=True,
    )
    print(zarray.fill_value)


test_bad_fill_value() # 4294967295

Additional output

No response

@dcherian dcherian added the bug Potential issues with the zarr-python library label Sep 18, 2024
@jhamman
Copy link
Member

jhamman commented Sep 24, 2024

fixed by #2209

@jhamman jhamman closed this as completed Sep 24, 2024
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

2 participants