MCPcopy Create free account
hub / github.com/numpy/numpy / params_1

Function params_1

numpy/random/tests/test_smoke.py:29–59  ·  view source on GitHub ↗
(f, bounded=False)

Source from the content-addressed store, hash-verified

27
28
29def params_1(f, bounded=False):
30 a = 5.0
31 b = np.arange(2.0, 12.0)
32 c = np.arange(2.0, 102.0).reshape((10, 10))
33 d = np.arange(2.0, 1002.0).reshape((10, 10, 10))
34 e = np.array([2.0, 3.0])
35 g = np.arange(2.0, 12.0).reshape((1, 10, 1))
36 if bounded:
37 a = 0.5
38 b = b / (1.5 * b.max())
39 c = c / (1.5 * c.max())
40 d = d / (1.5 * d.max())
41 e = e / (1.5 * e.max())
42 g = g / (1.5 * g.max())
43
44 # Scalar
45 f(a)
46 # Scalar - size
47 f(a, size=(10, 10))
48 # 1d
49 f(b)
50 # 2d
51 f(c)
52 # 3d
53 f(d)
54 # 1d size
55 f(b, size=10)
56 # 2d - size - broadcast
57 f(e, size=(10, 2))
58 # 3d - size
59 f(g, size=(10, 10, 10))
60
61
62def comp_state(state1, state2):

Callers 7

test_standard_gammaMethod · 0.85
test_standard_tMethod · 0.85
test_chisquareMethod · 0.85
test_exponentialMethod · 0.85
test_geometricMethod · 0.85
test_poissonMethod · 0.85
test_rayleighMethod · 0.85

Calls 3

fFunction · 0.85
reshapeMethod · 0.80
maxMethod · 0.45

Tested by

no test coverage detected