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

Function test_histogramdd_density

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

Source from the content-addressed store, hash-verified

1080
1081
1082def test_histogramdd_density():
1083 n1, n2 = 800, 3
1084 x = da.random.default_rng().uniform(0, 1, size=(n1, n2), chunks=(200, 3))
1085 bins = [[0, 0.5, 1], [0, 0.25, 0.85, 1], [0, 0.5, 0.8, 1]]
1086 (a1, b1) = da.histogramdd(x, bins=bins, density=True)
1087 (a2, b2) = np.histogramdd(x, bins=bins, density=True)
1088 (a3, b3) = da.histogramdd(x, bins=bins, normed=True)
1089 (a4, b4) = np.histogramdd(x.compute(), bins=bins, density=True)
1090 assert_eq(a1, a2)
1091 assert_eq(a1, a3)
1092 assert_eq(a1, a4)
1093 assert same_keys(da.histogramdd(x, bins=bins, density=True)[0], a1)
1094
1095
1096def test_histogramdd_weighted_density():

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected