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

Method test_p_non_contiguous

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

Source from the content-addressed store, hash-verified

166 assert_raises(ValueError, random.multinomial, -1, [0.8, 0.2])
167
168 def test_p_non_contiguous(self):
169 p = np.arange(15.)
170 p /= np.sum(p[1::3])
171 pvals = p[1::3]
172 random.seed(1432985819)
173 non_contig = random.multinomial(100, pvals=pvals)
174 random.seed(1432985819)
175 contig = random.multinomial(100, pvals=np.ascontiguousarray(pvals))
176 assert_array_equal(non_contig, contig)
177
178 def test_multinomial_pvals_float32(self):
179 x = np.array([9.9e-01, 9.9e-01, 1.0e-09, 1.0e-09, 1.0e-09, 1.0e-09,

Callers

nothing calls this directly

Calls 2

assert_array_equalFunction · 0.90
sumMethod · 0.45

Tested by

no test coverage detected