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

Method test_fweights

numpy/lib/tests/test_function_base.py:2634–2648  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2632 assert_allclose(cov(self.x3, ddof=1), np.var(self.x3, ddof=1))
2633
2634 def test_fweights(self):
2635 assert_allclose(cov(self.x2, fweights=self.frequencies),
2636 cov(self.x2_repeats))
2637 assert_allclose(cov(self.x1, fweights=self.frequencies),
2638 self.res2)
2639 assert_allclose(cov(self.x1, fweights=self.unit_frequencies),
2640 self.res1)
2641 nonint = self.frequencies + 0.5
2642 assert_raises(TypeError, cov, self.x1, fweights=nonint)
2643 f = np.ones((2, 3), dtype=np.int_)
2644 assert_raises(RuntimeError, cov, self.x1, fweights=f)
2645 f = np.ones(2, dtype=np.int_)
2646 assert_raises(RuntimeError, cov, self.x1, fweights=f)
2647 f = -1 * np.ones(3, dtype=np.int_)
2648 assert_raises(ValueError, cov, self.x1, fweights=f)
2649
2650 def test_aweights(self):
2651 assert_allclose(cov(self.x1, aweights=self.weights), self.res3)

Callers

nothing calls this directly

Calls 3

assert_allcloseFunction · 0.90
covFunction · 0.90
assert_raisesFunction · 0.90

Tested by

no test coverage detected