8000 setitem with repeated indices is not guaranteed in practice · Issue #2855 · zarr-developers/zarr-python · GitHub
[go: up one dir, main page]

Skip to content
setitem with repeated indices is not guaranteed in practice #2855
Open
@dcherian

Description

@dcherian

Zarr version

v2.18.3, 3.0.2 and 3.0.3

Numcodecs version

?

Python Version

?

Operating System

linux & windows

Installation

either

Description

behaviour of setitem with repeated indices depends on platform. The example below succeeds on Mac and fails on ubuntu, windows with numpy 2.2. It succeeds in all CI environments with numpy 1.25.

I can reproduce on zarr v2.18.4, v3.0.2 on linux.

I say we disallow this

Steps to reproduce

import zarr
import numpy as np

array = zarr.array(data=np.zeros((4,)), chunks=(1,))
indexer = np.array([-1, -1, 0, 0])
array.oindex[(indexer,)] = [0, 1, 2, 3]
np.testing.assert_array_equal(array[:], np.array([3, 0, 0, 1]))

fails on windows & linux, numpy=2.2 in CI.

cc @LDeakin @ilan-gold

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPotential issues with the zarr-python library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0