-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cannot overwrite Zarr opened with mode= "a"
#376
Comments
I can reproduce; here's the full traceback: Traceback (most recent call last):
File "/Users/dstansby/software/zarr/ome-zarr-py/test.py", line 12, in <module>
ome_zarr.writer.write_image(image=vol, group=root2, axes="zyx",chunks=128)
File "/Users/dstansby/software/zarr/ome-zarr-py/ome_zarr/writer.py", line 516, in write_image
dask_delayed_jobs = write_multiscale(
^^^^^^^^^^^^^^^^^
File "/Users/dstansby/software/zarr/ome-zarr-py/ome_zarr/writer.py", line 267, in write_multiscale
group.create_dataset(str(path), data=data, chunks=chunks_opt, **options)
File "/Users/dstansby/miniconda3/envs/zarr/lib/python3.12/site-packages/zarr/hierarchy.py", line 1111, in create_dataset
return self._write_op(self._create_dataset_nosync, name, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dstansby/miniconda3/envs/zarr/lib/python3.12/site-packages/zarr/hierarchy.py", line 952, in _write_op
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/Users/dstansby/miniconda3/envs/zarr/lib/python3.12/site-packages/zarr/hierarchy.py", line 1126, in _create_dataset_nosync
a = array(data, store=self._store, path=path, chunk_store=self._chunk_store, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dstansby/miniconda3/envs/zarr/lib/python3.12/site-packages/zarr/creation.py", line 441, in array
z = create(**kwargs)
^^^^^^^^^^^^^^^^
File "/Users/dstansby/miniconda3/envs/zarr/lib/python3.12/site-packages/zarr/creation.py", line 209, in create
init_array(
File "/Users/dstansby/miniconda3/envs/zarr/lib/python3.12/site-packages/zarr/storage.py", line 455, in init_array
_init_array_metadata(
File "/Users/dstansby/miniconda3/envs/zarr/lib/python3.12/site-packages/zarr/storage.py", line 524, in _init_array_metadata
raise ContainsArrayError(path)
zarr.errors.ContainsArrayError: path '0' contains an array |
Without looking more deeply, I assume that the Store is getting re-created and all flags are not being passed. Could you test if the same happens when passing an FSStore a la #349? |
@joshmoore #349 allows you to use an existing store to create a Anyway, I tried using the manually-created store and got the same error as above:
|
To my understanding,
zarr
supports rewriting with themode= "a"
. However, it is not supported byome-zarr-py
.Example code
What I expect
To be able to overwrite the file
all_zeros.ome.zarr
when I specifymode= "a"
.What I get
(Error log: full_error.txt)
The text was updated successfully, but these errors were encountered: