-
-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZipStore fails to handle scalar string arrays #551
Comments
Ah missed this was string related. Sorry about that. On the bright side this may be an easy resolution. Basically we need an |
Thoughts @hmaarrfk? 🙂 |
I may be able to work on this stuff after October. Thanks for looking into this with me. |
honestly, i ligitimitely might have to revisit this now. For this, why is it not a problem with the standard store? Shouldn't this be definied higher up, and not specifically related to the ZipStore? |
I guess the correct location to put this is in diff --git a/zarr/util.py b/zarr/util.py
index 241009c..c432ed3 100644
--- a/zarr/util.py
+++ b/zarr/util.py
@@ -135,6 +135,9 @@ def normalize_chunks(chunks, shape, typesize):
def normalize_dtype(dtype, object_codec):
+ # Ensure that all types of numpy unicode strings are treaded as strings
+ if np.issubdtype(np.unicode_, dtype):
+ dtype = str
# convenience API for object arrays
if inspect.isclass(dtype):
dtype = dtype.__name__ |
Did you try using an object codec as noted here ( #551 (comment) )? That's typically how we recommend handling Python objects (like |
unfortunately, it ignores it because |
Recent work by @abergou may have improved the situation with object codecs. |
Guessing that is referring to PR ( #813 ) in Zarr 2.9.4+ |
Minimal, reproducible code sample, a copy-pastable example if possible
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: pydata/xarray#3815
I think this works in the typical directory store.
Version and installation information
Please provide the following:
zarr.__version__
:2.4.0
numcodecs.__version__
:0.6.4
Also, if you think it might be relevant, please provide the output from
pip freeze
orconda env export
depending on which was used to install Zarr.The text was updated successfully, but these errors were encountered: