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

Method test_uniform_float

numpy/random/tests/test_direct.py:260–271  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

258 assert_equal(uniforms.dtype, np.float64)
259
260 def test_uniform_float(self):
261 rs = Generator(self.bit_generator(*self.data1['seed']))
262 vals = uniform32_from_uint(self.data1['data'], self.bits)
263 uniforms = rs.random(len(vals), dtype=np.float32)
264 assert_allclose(uniforms, vals)
265 assert_equal(uniforms.dtype, np.float32)
266
267 rs = Generator(self.bit_generator(*self.data2['seed']))
268 vals = uniform32_from_uint(self.data2['data'], self.bits)
269 uniforms = rs.random(len(vals), dtype=np.float32)
270 assert_allclose(uniforms, vals)
271 assert_equal(uniforms.dtype, np.float32)
272
273 def test_repr(self):
274 rs = Generator(self.bit_generator(*self.data1['seed']))

Callers

nothing calls this directly

Calls 4

assert_allcloseFunction · 0.90
assert_equalFunction · 0.90
uniform32_from_uintFunction · 0.85
randomMethod · 0.80

Tested by

no test coverage detected