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

Method test_aweights

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

Source from the content-addressed store, hash-verified

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)
2652 assert_allclose(cov(self.x1, aweights=3.0 * self.weights),
2653 cov(self.x1, aweights=self.weights))
2654 assert_allclose(cov(self.x1, aweights=self.unit_weights), self.res1)
2655 w = np.ones((2, 3))
2656 assert_raises(RuntimeError, cov, self.x1, aweights=w)
2657 w = np.ones(2)
2658 assert_raises(RuntimeError, cov, self.x1, aweights=w)
2659 w = -1.0 * np.ones(3)
2660 assert_raises(ValueError, cov, self.x1, aweights=w)
2661
2662 def test_unit_fweights_and_aweights(self):
2663 assert_allclose(cov(self.x2, fweights=self.frequencies,

Callers

nothing calls this directly

Calls 3

assert_allcloseFunction · 0.90
covFunction · 0.90
assert_raisesFunction · 0.90

Tested by

no test coverage detected