question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ZipStore fails to handle scalar string arrays

See original GitHub issue

Minimal, 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:open
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jakirkhamcommented, Sep 22, 2021

Guessing that is referring to PR ( https://github.com/zarr-developers/zarr-python/pull/813 ) in Zarr 2.9.4+

0reactions
joshmoorecommented, Sep 22, 2021

Recent work by @abergou may have improved the situation with object codecs.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found