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

Method test_aweights

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

Source from the content-addressed store, hash-verified

2384 assert_raises(ValueError, cov, self.x1, fweights=f)
2385
2386 def test_aweights(self):
2387 assert_allclose(cov(self.x1, aweights=self.weights), self.res3)
2388 assert_allclose(cov(self.x1, aweights=3.0 * self.weights),
2389 cov(self.x1, aweights=self.weights))
2390 assert_allclose(cov(self.x1, aweights=self.unit_weights), self.res1)
2391 w = np.ones((2, 3))
2392 assert_raises(RuntimeError, cov, self.x1, aweights=w)
2393 w = np.ones(2)
2394 assert_raises(RuntimeError, cov, self.x1, aweights=w)
2395 w = -1.0 * np.ones(3)
2396 assert_raises(ValueError, cov, self.x1, aweights=w)
2397
2398 def test_unit_fweights_and_aweights(self):
2399 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