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

Method test_two_arg_funcs

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

Source from the content-addressed store, hash-verified

1662 assert_equal(out.shape, tgtShape)
1663
1664 def test_two_arg_funcs(self):
1665 argOne, argTwo, _, tgtShape = self._create_arrays()
1666 funcs = (np.random.uniform, np.random.normal,
1667 np.random.beta, np.random.gamma,
1668 np.random.f, np.random.noncentral_chisquare,
1669 np.random.vonmises, np.random.laplace,
1670 np.random.gumbel, np.random.logistic,
1671 np.random.lognormal, np.random.wald,
1672 np.random.binomial, np.random.negative_binomial)
1673
1674 probfuncs = (np.random.binomial, np.random.negative_binomial)
1675
1676 for func in funcs:
1677 if func in probfuncs: # p <= 1
1678 argTwo = np.array([0.5])
1679
1680 else:
1681 argTwo = argTwo
1682
1683 out = func(argOne, argTwo)
1684 assert_equal(out.shape, tgtShape)
1685
1686 out = func(argOne[0], argTwo)
1687 assert_equal(out.shape, tgtShape)
1688
1689 out = func(argOne, argTwo[0])
1690 assert_equal(out.shape, tgtShape)
1691
1692 def test_randint(self):
1693 _, _, _, tgtShape = self._create_arrays()

Callers

nothing calls this directly

Calls 3

_create_arraysMethod · 0.95
assert_equalFunction · 0.90
funcFunction · 0.50

Tested by

no test coverage detected