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

Method test_power

numpy/random/tests/test_randomstate.py:1586–1598  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1584 assert_raises(ValueError, random.weibull, bad_a * 3)
1585
1586 def test_power(self):
1587 a = [1]
1588 bad_a = [-1]
1589 power = random.power
1590 desired = np.array([0.53283302478975902,
1591 0.53413660089041659,
1592 0.50955303552646702])
1593
1594 self.set_seed()
1595 actual = power(a * 3)
1596 assert_array_almost_equal(actual, desired, decimal=14)
1597 assert_raises(ValueError, power, bad_a * 3)
1598 assert_raises(ValueError, random.power, bad_a * 3)
1599
1600 def test_laplace(self):
1601 loc = [0]

Callers

nothing calls this directly

Calls 4

set_seedMethod · 0.95
assert_raisesFunction · 0.90
powerFunction · 0.50

Tested by

no test coverage detected