MCPcopy Index your code
hub / github.com/numpy/numpy / test_uniform

Method test_uniform

numpy/random/tests/test_generator_mt19937.py:1915–1928  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1913 seed = 123456789
1914
1915 def test_uniform(self):
1916 random = Generator(MT19937(self.seed))
1917 low = [0]
1918 high = [1]
1919 uniform = random.uniform
1920 desired = np.array([0.16693771389729, 0.19635129550675, 0.75563050964095])
1921
1922 random = Generator(MT19937(self.seed))
1923 actual = random.uniform(low * 3, high)
1924 assert_array_almost_equal(actual, desired, decimal=14)
1925
1926 random = Generator(MT19937(self.seed))
1927 actual = random.uniform(low, high * 3)
1928 assert_array_almost_equal(actual, desired, decimal=14)
1929
1930 def test_normal(self):
1931 loc = [0]

Callers

nothing calls this directly

Calls 2

uniformMethod · 0.80

Tested by

no test coverage detected