MCPcopy Create free account
hub / github.com/dask/dask / test_histogramdd

Function test_histogramdd

dask/array/tests/test_routines.py:1009–1021  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1007
1008
1009def test_histogramdd():
1010 n1, n2 = 800, 3
1011 x = da.random.default_rng().uniform(0, 1, size=(n1, n2), chunks=(200, 3))
1012 bins = [[0, 0.5, 1], [0, 0.25, 0.85, 1], [0, 0.5, 0.8, 1]]
1013 (a1, b1) = da.histogramdd(x, bins=bins)
1014 (a2, b2) = np.histogramdd(x, bins=bins)
1015 (a3, b3) = np.histogramdd(x.compute(), bins=bins)
1016 assert_eq(a1, a2)
1017 assert_eq(a1, a3)
1018 assert a1.sum() == n1
1019 assert a2.sum() == n1
1020 assert same_keys(da.histogramdd(x, bins=bins)[0], a1)
1021 assert a1.compute().shape == a3.shape
1022
1023
1024def test_histogramdd_seq_of_arrays():

Callers

nothing calls this directly

Calls 5

assert_eqFunction · 0.90
same_keysFunction · 0.90
uniformMethod · 0.45
computeMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected