issue_comments: 652104356
This data as json
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/pydata/xarray/pull/4187#issuecomment-652104356 | https://api.github.com/repos/pydata/xarray/issues/4187 | 652104356 | MDEyOklzc3VlQ29tbWVudDY1MjEwNDM1Ng== | 23487320 | 2020-06-30T23:42:58Z | 2020-07-01T03:04:11Z | CONTRIBUTOR | Four more failures, something to do with dask? Seems related to #3919 and #3921.
Edit: Fixed the
```python-traceback
=================================== FAILURES ===================================
__________________ TestZarrDictStore.test_vectorized_indexing __________________
self = <xarray.tests.test_backends.TestZarrDictStore object at 0x7f5832433940>
@pytest.mark.xfail(
not has_dask,
reason="the code for indexing without dask handles negative steps in slices incorrectly",
)
def test_vectorized_indexing(self):
in_memory = create_test_data()
with self.roundtrip(in_memory) as on_disk:
indexers = {
"dim1": DataArray([0, 2, 0], dims="a"),
"dim2": DataArray([0, 2, 3], dims="a"),
}
expected = in_memory.isel(**indexers)
actual = on_disk.isel(**indexers)
# make sure the array is not yet loaded into memory
assert not actual["var1"].variable._in_memory
assert_identical(expected, actual.load())
# do it twice, to make sure we're switched from
# vectorized -> numpy when we cached the values
actual = on_disk.isel(**indexers)
assert_identical(expected, actual)
def multiple_indexing(indexers):
# make sure a sequence of lazy indexings certainly works.
with self.roundtrip(in_memory) as on_disk:
actual = on_disk["var3"]
expected = in_memory["var3"]
for ind in indexers:
actual = actual.isel(**ind)
expected = expected.isel(**ind)
# make sure the array is not yet loaded into memory
assert not actual.variable._in_memory
assert_identical(expected, actual.load())
# two-staged vectorized-indexing
indexers = [
{
"dim1": DataArray([[0, 7], [2, 6], [3, 5]], dims=["a", "b"]),
"dim3": DataArray([[0, 4], [1, 3], [2, 2]], dims=["a", "b"]),
},
{"a": DataArray([0, 1], dims=["c"]), "b": DataArray([0, 1], dims=["c"])},
]
multiple_indexing(indexers)
# vectorized-slice mixed
indexers = [
{
"dim1": DataArray([[0, 7], [2, 6], [3, 5]], dims=["a", "b"]),
"dim3": slice(None, 10),
}
]
multiple_indexing(indexers)
# vectorized-integer mixed
indexers = [
{"dim3": 0},
{"dim1": DataArray([[0, 7], [2, 6], [3, 5]], dims=["a", "b"])},
{"a": slice(None, None, 2)},
]
multiple_indexing(indexers)
# vectorized-integer mixed
indexers = [
{"dim3": 0},
{"dim1": DataArray([[0, 7], [2, 6], [3, 5]], dims=["a", "b"])},
{"a": 1, "b": 0},
]
multiple_indexing(indexers)
# with negative step slice.
indexers = [
{
"dim1": DataArray([[0, 7], [2, 6], [3, 5]], dims=["a", "b"]),
"dim3": slice(-1, 1, -1),
}
]
> multiple_indexing(indexers)
xarray/tests/test_backends.py:686:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
xarray/tests/test_backends.py:642: in multiple_indexing
assert_identical(expected, actual.load())
xarray/core/dataarray.py:814: in load
ds = self._to_temp_dataset().load(**kwargs)
xarray/core/dataset.py:666: in load
v.load()
xarray/core/variable.py:381: in load
self._data = np.asarray(self._data)
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/numpy/core/numeric.py:501: in asarray
return array(a, dtype, copy=False, order=order)
xarray/core/indexing.py:677: in __array__
self._ensure_cached()
xarray/core/indexing.py:674: in _ensure_cached
self.array = NumpyIndexingAdapter(np.asarray(self.array))
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/numpy/core/numeric.py:501: in asarray
return array(a, dtype, copy=False, order=order)
xarray/core/indexing.py:653: in __array__
return np.asarray(self.array, dtype=dtype)
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/numpy/core/numeric.py:501: in asarray
return array(a, dtype, copy=False, order=order)
xarray/core/indexing.py:557: in __array__
return np.asarray(array[self.key], dtype=None)
xarray/backends/zarr.py:57: in __getitem__
return array[key.tuple]
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/zarr/core.py:572: in __getitem__
return self.get_basic_selection(selection, fields=fields)
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/zarr/core.py:698: in get_basic_selection
fields=fields)
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/zarr/core.py:738: in _get_basic_selection_nd
indexer = BasicIndexer(selection, self)
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/zarr/indexing.py:279: in __init__
dim_indexer = SliceDimIndexer(dim_sel, dim_len, dim_chunk_len)
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/zarr/indexing.py:107: in __init__
err_negative_step()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def err_negative_step():
> raise IndexError('only slices with step >= 1 are supported')
E IndexError: only slices with step >= 1 are supported
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/zarr/errors.py:55: IndexError
_____________________ TestZarrDictStore.test_manual_chunk ______________________
self = <xarray.tests.test_backends.TestZarrDictStore object at 0x7f5832b80cf8>
@requires_dask
@pytest.mark.filterwarnings("ignore:Specified Dask chunks")
def test_manual_chunk(self):
original = create_test_data().chunk({"dim1": 3, "dim2": 4, "dim3": 3})
# All of these should return non-chunked arrays
NO_CHUNKS = (None, 0, {})
for no_chunk in NO_CHUNKS:
open_kwargs = {"chunks": no_chunk}
> with self.roundtrip(original, open_kwargs=open_kwargs) as actual:
xarray/tests/test_backends.py:1594:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/contextlib.py:81: in __enter__
return next(self.gen)
xarray/tests/test_backends.py:1553: in roundtrip
with self.open(store_target, **open_kwargs) as ds:
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/contextlib.py:81: in __enter__
return next(self.gen)
xarray/tests/test_backends.py:1540: in open
with xr.open_dataset(store_target, engine="zarr", **kwargs) as ds:
xarray/backends/api.py:587: in open_dataset
ds = maybe_decode_store(store, chunks)
xarray/backends/api.py:511: in maybe_decode_store
for k, v in ds.variables.items()
xarray/backends/api.py:511: in <dictcomp>
for k, v in ds.variables.items()
xarray/backends/zarr.py:398: in maybe_chunk
var = var.chunk(chunk_spec, name=name2, lock=None)
xarray/core/variable.py:1007: in chunk
data = da.from_array(data, chunks, name=name, lock=lock, **kwargs)
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/dask/array/core.py:2712: in from_array
chunks, x.shape, dtype=x.dtype, previous_chunks=previous_chunks
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/dask/array/core.py:2447: in normalize_chunks
(),
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/dask/array/core.py:2445: in <genexpr>
for s, c in zip(shape, chunks)
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/dask/array/core.py:954: in blockdims_from_blockshape
for d, bd in zip(shape, chunks)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.0 = <zip object at 0x7f58332d9d48>
((bd,) * (d // bd) + ((d % bd,) if d % bd else ()) if d else (0,))
> for d, bd in zip(shape, chunks)
)
E ZeroDivisionError: integer division or modulo by zero
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/dask/array/core.py:954: ZeroDivisionError
_______________ TestZarrDirectoryStore.test_vectorized_indexing ________________
self = <xarray.tests.test_backends.TestZarrDirectoryStore object at 0x7f5832a08a20>
@pytest.mark.xfail(
not has_dask,
reason="the code for indexing without dask handles negative steps in slices incorrectly",
)
def test_vectorized_indexing(self):
in_memory = create_test_data()
with self.roundtrip(in_memory) as on_disk:
indexers = {
"dim1": DataArray([0, 2, 0], dims="a"),
"dim2": DataArray([0, 2, 3], dims="a"),
}
expected = in_memory.isel(**indexers)
actual = on_disk.isel(**indexers)
# make sure the array is not yet loaded into memory
assert not actual["var1"].variable._in_memory
assert_identical(expected, actual.load())
# do it twice, to make sure we're switched from
# vectorized -> numpy when we cached the values
actual = on_disk.isel(**indexers)
assert_identical(expected, actual)
def multiple_indexing(indexers):
# make sure a sequence of lazy indexings certainly works.
with self.roundtrip(in_memory) as on_disk:
actual = on_disk["var3"]
expected = in_memory["var3"]
for ind in indexers:
actual = actual.isel(**ind)
expected = expected.isel(**ind)
# make sure the array is not yet loaded into memory
assert not actual.variable._in_memory
assert_identical(expected, actual.load())
# two-staged vectorized-indexing
indexers = [
{
"dim1": DataArray([[0, 7], [2, 6], [3, 5]], dims=["a", "b"]),
"dim3": DataArray([[0, 4], [1, 3], [2, 2]], dims=["a", "b"]),
},
{"a": DataArray([0, 1], dims=["c"]), "b": DataArray([0, 1], dims=["c"])},
]
multiple_indexing(indexers)
# vectorized-slice mixed
indexers = [
{
"dim1": DataArray([[0, 7], [2, 6], [3, 5]], dims=["a", "b"]),
"dim3": slice(None, 10),
}
]
multiple_indexing(indexers)
# vectorized-integer mixed
indexers = [
{"dim3": 0},
{"dim1": DataArray([[0, 7], [2, 6], [3, 5]], dims=["a", "b"])},
{"a": slice(None, None, 2)},
]
multiple_indexing(indexers)
# vectorized-integer mixed
indexers = [
{"dim3": 0},
{"dim1": DataArray([[0, 7], [2, 6], [3, 5]], dims=["a", "b"])},
{"a": 1, "b": 0},
]
multiple_indexing(indexers)
# with negative step slice.
indexers = [
{
"dim1": DataArray([[0, 7], [2, 6], [3, 5]], dims=["a", "b"]),
"dim3": slice(-1, 1, -1),
}
]
> multiple_indexing(indexers)
xarray/tests/test_backends.py:686:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
xarray/tests/test_backends.py:642: in multiple_indexing
assert_identical(expected, actual.load())
xarray/core/dataarray.py:814: in load
ds = self._to_temp_dataset().load(**kwargs)
xarray/core/dataset.py:666: in load
v.load()
xarray/core/variable.py:381: in load
self._data = np.asarray(self._data)
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/numpy/core/numeric.py:501: in asarray
return array(a, dtype, copy=False, order=order)
xarray/core/indexing.py:677: in __array__
self._ensure_cached()
xarray/core/indexing.py:674: in _ensure_cached
self.array = NumpyIndexingAdapter(np.asarray(self.array))
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/numpy/core/numeric.py:501: in asarray
return array(a, dtype, copy=False, order=order)
xarray/core/indexing.py:653: in __array__
return np.asarray(self.array, dtype=dtype)
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/numpy/core/numeric.py:501: in asarray
return array(a, dtype, copy=False, order=order)
xarray/core/indexing.py:557: in __array__
return np.asarray(array[self.key], dtype=None)
xarray/backends/zarr.py:57: in __getitem__
return array[key.tuple]
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/zarr/core.py:572: in __getitem__
return self.get_basic_selection(selection, fields=fields)
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/zarr/core.py:698: in get_basic_selection
fields=fields)
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/zarr/core.py:738: in _get_basic_selection_nd
indexer = BasicIndexer(selection, self)
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/zarr/indexing.py:279: in __init__
dim_indexer = SliceDimIndexer(dim_sel, dim_len, dim_chunk_len)
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/zarr/indexing.py:107: in __init__
err_negative_step()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def err_negative_step():
> raise IndexError('only slices with step >= 1 are supported')
E IndexError: only slices with step >= 1 are supported
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/zarr/errors.py:55: IndexError
___________________ TestZarrDirectoryStore.test_manual_chunk ___________________
self = <xarray.tests.test_backends.TestZarrDirectoryStore object at 0x7f5831763ef0>
@requires_dask
@pytest.mark.filterwarnings("ignore:Specified Dask chunks")
def test_manual_chunk(self):
original = create_test_data().chunk({"dim1": 3, "dim2": 4, "dim3": 3})
# All of these should return non-chunked arrays
NO_CHUNKS = (None, 0, {})
for no_chunk in NO_CHUNKS:
open_kwargs = {"chunks": no_chunk}
> with self.roundtrip(original, open_kwargs=open_kwargs) as actual:
xarray/tests/test_backends.py:1594:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/contextlib.py:81: in __enter__
return next(self.gen)
xarray/tests/test_backends.py:1553: in roundtrip
with self.open(store_target, **open_kwargs) as ds:
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/contextlib.py:81: in __enter__
return next(self.gen)
xarray/tests/test_backends.py:1540: in open
with xr.open_dataset(store_target, engine="zarr", **kwargs) as ds:
xarray/backends/api.py:587: in open_dataset
ds = maybe_decode_store(store, chunks)
xarray/backends/api.py:511: in maybe_decode_store
for k, v in ds.variables.items()
xarray/backends/api.py:511: in <dictcomp>
for k, v in ds.variables.items()
xarray/backends/zarr.py:398: in maybe_chunk
var = var.chunk(chunk_spec, name=name2, lock=None)
xarray/core/variable.py:1007: in chunk
data = da.from_array(data, chunks, name=name, lock=lock, **kwargs)
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/dask/array/core.py:2712: in from_array
chunks, x.shape, dtype=x.dtype, previous_chunks=previous_chunks
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/dask/array/core.py:2447: in normalize_chunks
(),
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/dask/array/core.py:2445: in <genexpr>
for s, c in zip(shape, chunks)
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/dask/array/core.py:954: in blockdims_from_blockshape
for d, bd in zip(shape, chunks)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.0 = <zip object at 0x7f58324b7f48>
((bd,) * (d // bd) + ((d % bd,) if d % bd else ()) if d else (0,))
> for d, bd in zip(shape, chunks)
)
E ZeroDivisionError: integer division or modulo by zero
/usr/share/miniconda/envs/xarray-tests/lib/python3.6/site-packages/dask/array/core.py:954: ZeroDivisionError
```
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
647804004 |