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

Method test_uniform_array

numpy/random/tests/test_smoke.py:157–170  ·  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 r = self.rg.uniform(np.array([-1.0] * 10), 0.0, size=10)
159 assert_(len(r) == 10)
160 assert_((r > -1).all())
161 assert_((r <= 0).all())
162 r = self.rg.uniform(np.array([-1.0] * 10),
163 np.array([0.0] * 10), size=10)
164 assert_(len(r) == 10)
165 assert_((r > -1).all())
166 assert_((r <= 0).all())
167 r = self.rg.uniform(-1.0, np.array([0.0] * 10), size=10)
168 assert_(len(r) == 10)
169 assert_((r > -1).all())
170 assert_((r <= 0).all())
171
172 def test_random(self):
173 assert_(len(self.rg.random(10)) == 10)

Callers

nothing calls this directly

Calls 3

assert_Function · 0.90
uniformMethod · 0.80
allMethod · 0.45

Tested by

no test coverage detected