MCPcopy
hub / github.com/numpy/numpy / test_uniform_float

Method test_uniform_float

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

Source from the content-addressed store, hash-verified

296 assert_equal(uniforms.dtype, np.float64)
297
298 def test_uniform_float(self):
299 rs = Generator(self.bit_generator(*self.data1['seed']))
300 vals = uniform32_from_uint(self.data1['data'], self.bits)
301 uniforms = rs.random(len(vals), dtype=np.float32)
302 assert_allclose(uniforms, vals)
303 assert_equal(uniforms.dtype, np.float32)
304
305 rs = Generator(self.bit_generator(*self.data2['seed']))
306 vals = uniform32_from_uint(self.data2['data'], self.bits)
307 uniforms = rs.random(len(vals), dtype=np.float32)
308 assert_allclose(uniforms, vals)
309 assert_equal(uniforms.dtype, np.float32)
310
311 def test_repr(self):
312 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