MCPcopy
hub / github.com/dask/dask / test_store_kwargs

Function test_store_kwargs

dask/array/tests/test_array_core.py:2061–2086  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2059
2060
2061def test_store_kwargs():
2062 d = da.ones((10, 10), chunks=(2, 2))
2063 a = d + 1
2064
2065 called = [False]
2066
2067 def get_func(*args, **kwargs):
2068 assert kwargs.pop("foo") == "test kwarg"
2069 r = dask.get(*args, **kwargs)
2070 called[0] = True
2071 return r
2072
2073 called[0] = False
2074 at = np.zeros(shape=(10, 10))
2075 store([a], [at], scheduler=get_func, foo="test kwarg")
2076 assert called[0]
2077
2078 called[0] = False
2079 at = np.zeros(shape=(10, 10))
2080 a.store(at, scheduler=get_func, foo="test kwarg")
2081 assert called[0]
2082
2083 called[0] = False
2084 at = np.zeros(shape=(10, 10))
2085 store([a], [at], scheduler=get_func, return_stored=True, foo="test kwarg")
2086 assert called[0]
2087
2088
2089def test_store_delayed_target():

Callers

nothing calls this directly

Calls 4

storeFunction · 0.90
storeMethod · 0.80
onesMethod · 0.45
zerosMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…