ZipStore fails to handle scalar string arrays
See original GitHub issueMinimal, reproducible code sample, a copy-pastable example if possible
import zarr
import numpy as np
name = 'hello'
data = np.array('world', dtype='<U5')
store = zarr.ZipStore('test_store.zip', mode='w')
root = zarr.open(store , mode='w')
zarr_array = root.create_dataset(name, data=data, shape=data.shape, dtype=data.dtype)
zarr_array[...]
# zarr_array = root.create_dataset(name, shape=data.shape, dtype=data.dtype)
# root[name][...] = data
# zarr_array[...]
Problem description
Scalar coordinates are useful as coordinates in xarray and likely other situations. Serializing them in zarr in a zipstore would be cool!.
xref: https://github.com/pydata/xarray/issues/3815
I think this works in the typical directory store.
Version and installation information
Please provide the following:
- Value of
zarr.__version__
:2.4.0
- Value of
numcodecs.__version__
:0.6.4
- Version of Python interpreter: 3.7
- Operating system (Linux/Windows/Mac): linux
- How Zarr was installed (e.g., “using pip into virtual environment”, or “using conda”): conda, conda-forge
Also, if you think it might be relevant, please provide the output from pip freeze
or
conda env export
depending on which was used to install Zarr.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Opening from zarr.ZipStore fails to read (store???) unicode ...
ZipStore('test_store.zip', mode='w') as store: x.to_zarr(store) with zarr. ... ZipStore fails to handle scalar string arrays ...
Read more >Tutorial — zarr 2.13.3 documentation - Read the Docs
Zarr arrays support a similar interface to NumPy arrays for reading and writing data. For example, the entire array can be filled with...
Read more >PHP - cannot use a scalar as an array warning - Stack Overflow
My code was working fine, and then it last night started spewing this error for some inexplicable reason, out of the clear blue...
Read more >Working with scalar lists/arrays (Concepts) - Prisma
The following example has one scalar String list named pets : Relational databases. MongoDB. model User {. id Int @id @default(autoincrement()). name String....
Read more >Frequently Asked Questions About String Arrays - MathWorks
Several differences between string arrays and character arrays can lead to unexpected results, for example, command form does not support strings as ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Guessing that is referring to PR ( https://github.com/zarr-developers/zarr-python/pull/813 ) in Zarr 2.9.4+
Recent work by @abergou may have improved the situation with object codecs.