Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Opening zarr store sequentially in write mode overwrites store #1427

@jdevng

Description

@jdevng

Zarr version

2.14.2

Numcodecs version

0.11

Python Version

3.10.9

Operating System

Mac OSX

Installation

pip into miniconda

Description

import zarr

Open store

z1 = zarr.open('data/example.zarr', mode='w', shape=(10000, 10000), chunks=(1000, 1000), dtype='i4')
z1[0,0] =41

Confirm value has been written

print("z1:" + str(z1[0,0]))

Open same store

z2 = zarr.open('data/example.zarr', mode='w', shape=(10000, 10000), chunks=(1000, 1000), dtype='i4')

Value is zero

print("z2:" + str(z2[0,0]))

Original value is also zero

print("z1:" + str(z1[0,0]))

python zarrMulti.py
z1:41
z2:0
z1:0

pip show zarr

Name: zarr
Version: 2.14.2
Summary: An implementation of chunked, compressed, N-dimensional arrays for Python

Steps to reproduce

Run script provided

Additional output

python zarrMulti.py
z1:41
z2:0
z1:0

This shows the value of the store that is written, and then loading the zarr store reflects that the data was either not stored, or the data is being overwritten.

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