MCPcopy
hub / github.com/dask/dask / test_keys_values_items_to_dict_methods

Function test_keys_values_items_to_dict_methods

dask/tests/test_highgraph.py:43–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41
42
43def test_keys_values_items_to_dict_methods():
44 pytest.importorskip("numpy")
45 da = pytest.importorskip("dask.array")
46 a = da.ones(10, chunks=(5,))
47 b = a + 1
48 c = a + 2
49 d = b + c
50 hg = d.dask
51
52 keys, values, items = hg.keys(), hg.values(), hg.items()
53 assert isinstance(keys, Set)
54 assert list(keys) == list(hg)
55 assert list(values) == [hg[i] for i in hg]
56 assert list(items) == list(zip(keys, values))
57 assert hg.to_dict() == dict(hg)
58
59
60def test_getitem():

Callers

nothing calls this directly

Calls 5

to_dictMethod · 0.80
onesMethod · 0.45
keysMethod · 0.45
valuesMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…