MCPcopy
hub / github.com/numpy/numpy / test_uniform_array

Method test_uniform_array

numpy/random/tests/test_smoke.py:157–171  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

155 assert_((r <= 0).all())
156
157 def test_uniform_array(self):
158 rg = self._create_rng().rg
159 r = rg.uniform(np.array([-1.0] * 10), 0.0, size=10)
160 assert_(len(r) == 10)
161 assert_((r > -1).all())
162 assert_((r <= 0).all())
163 r = rg.uniform(np.array([-1.0] * 10),
164 np.array([0.0] * 10), size=10)
165 assert_(len(r) == 10)
166 assert_((r > -1).all())
167 assert_((r <= 0).all())
168 r = rg.uniform(-1.0, np.array([0.0] * 10), size=10)
169 assert_(len(r) == 10)
170 assert_((r > -1).all())
171 assert_((r <= 0).all())
172
173 def test_random(self):
174 rg = self._create_rng().rg

Callers

nothing calls this directly

Calls 4

_create_rngMethod · 0.95
assert_Function · 0.90
uniformMethod · 0.80
allMethod · 0.45

Tested by

no test coverage detected