FutureWarning from zarr.open
See original GitHub issueThe following code snippet will raise a FutureWarning:
import numpy
import zarr
group = zarr.open()
group.create('foo', dtype=[('a', int), ('b', int)], fill_value=numpy.zeros((), dtype=[('a', int), ('b', int)])[()], shape=(10, 10))
Problem description
The current behavior raises a FutureWarning:
zarr/util.py:238: FutureWarning: elementwise == comparison failed and returning scalar instead; this will raise an error or perform elementwise comparison in the future.
elif fill_value == 0:
This happens because of the comparison of the utterable dtype to 0 (in line 258) above. I’m not sure if this error is a false positive from numpy or something that will actually break in a future numpy version.
Version and installation information
Please provide the following:
- Value of
zarr.__version__
: ‘2.3.2’ - Value of
numcodecs.__version__
: ‘0.6.4’ - Version of Python interpreter: 3.7.6
- Operating system (Linux/Windows/Mac): Mac and Linux
- How Zarr was installed: using conda (also from source)
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Tutorial — zarr 2.13.3 documentation - Read the Docs
The zarr.convenience.open() function provides a convenient way to create a new persistent array or continue working with an existing array.
Read more >Python zarr.open() Examples - ProgramCreek.com
This page shows Python examples of zarr.open. ... The following are 30 code examples of zarr.open(). ... FutureWarning, ) return pd.
Read more >What's New - Xarray
This release brings the ability to write to limited regions of zarr files, open zarr files with open_dataset() and open_mfdataset() , increased support...
Read more >Source code for dask.array.core
category=FutureWarning, ) name = token name = f"{name or ... Parameters ---------- arr: dask.array Data to store url: Zarr Array or str or...
Read more >Test ZARR performance for CAB-LAB data cubes
import xarray as xr import zarr from esdl import Cube. In [31]: ... ~60 GB cube = Cube.open('C:\\Users\\Norman\\EOData\\cablab-datacube-1.0.0\\low-res').
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
Doh. Sorry, @maiia-pi, I somehow lost a comment I had prepared. More briefly, it looks like @d-v-b ran into this issue here:
https://github.com/zarr-developers/zarr-python/pull/738/files#diff-f389c1f0162cd60b1b5a4187dad20dfd3d22c98da2ebe22e860ea830bc25a0e9R692
You might try to use his
zarr.util.all_equal
method and see if it will fix it, but I assume that this is a bigger problem if we didn’t have a suggestion.Tried this code snippet above to check if the issue remains
Future Warning still rises.