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

Method test_unit_fweights_and_aweights

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

Source from the content-addressed store, hash-verified

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,
2400 aweights=self.unit_weights),
2401 cov(self.x2_repeats))
2402 assert_allclose(cov(self.x1, fweights=self.frequencies,
2403 aweights=self.unit_weights),
2404 self.res2)
2405 assert_allclose(cov(self.x1, fweights=self.unit_frequencies,
2406 aweights=self.unit_weights),
2407 self.res1)
2408 assert_allclose(cov(self.x1, fweights=self.unit_frequencies,
2409 aweights=self.weights),
2410 self.res3)
2411 assert_allclose(cov(self.x1, fweights=self.unit_frequencies,
2412 aweights=3.0 * self.weights),
2413 cov(self.x1, aweights=self.weights))
2414 assert_allclose(cov(self.x1, fweights=self.unit_frequencies,
2415 aweights=self.unit_weights),
2416 self.res1)
2417
2418 @pytest.mark.parametrize("test_type", [np.half, np.single, np.double, np.longdouble])
2419 def test_cov_dtype(self, test_type):

Callers

nothing calls this directly

Calls 2

assert_allcloseFunction · 0.90
covFunction · 0.90

Tested by

no test coverage detected