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

Method test_power

numpy/random/tests/test_random.py:1324–1335  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1322 assert_raises(ValueError, weibull, bad_a * 3)
1323
1324 def test_power(self):
1325 a = [1]
1326 bad_a = [-1]
1327 power = np.random.power
1328 desired = np.array([0.53283302478975902,
1329 0.53413660089041659,
1330 0.50955303552646702])
1331
1332 self.setSeed()
1333 actual = power(a * 3)
1334 assert_array_almost_equal(actual, desired, decimal=14)
1335 assert_raises(ValueError, power, bad_a * 3)
1336
1337 def test_laplace(self):
1338 loc = [0]

Callers

nothing calls this directly

Calls 4

setSeedMethod · 0.95
assert_raisesFunction · 0.90
powerFunction · 0.50

Tested by

no test coverage detected