MCPcopy
hub / github.com/dask/dask / test_nan_empty_like

Function test_nan_empty_like

dask/array/tests/test_creation.py:1074–1083  ·  view source on GitHub ↗
(shape_chunks, dtype)

Source from the content-addressed store, hash-verified

1072@pytest.mark.parametrize("shape_chunks", [((50, 4), (10, 2)), ((50,), (10,))])
1073@pytest.mark.parametrize("dtype", ["u4", np.float32, None, np.int64])
1074def test_nan_empty_like(shape_chunks, dtype):
1075 shape, chunks = shape_chunks
1076 x1 = da.random.standard_normal(size=shape, chunks=chunks)
1077 y1 = x1[x1 < 0.5]
1078 x2 = x1.compute()
1079 y2 = x2[x2 < 0.5]
1080 a_da = da.empty_like(y1, dtype=dtype).compute()
1081 a_np = np.empty_like(y2, dtype=dtype)
1082 assert a_da.shape == a_np.shape
1083 assert a_da.dtype == a_np.dtype
1084
1085
1086@pytest.mark.parametrize("val", [0, 0.0, 99, -1])

Callers

nothing calls this directly

Calls 2

standard_normalMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…