def test_arithmetic_cov():
 cov = read_cov(cov_fname)
 cov_sum = (cov + cov)
 assert_array_almost_equal((2 * cov.nfree), cov_sum.nfree)
 assert_array_almost_equal((2 * cov.data), cov_sum.data)
 assert_true((cov.ch_names == cov_sum.ch_names))
 cov += cov
 assert_array_almost_equal(cov_sum.nfree, cov.nfree)
 assert_array_almost_equal(cov_sum.data, cov.data)
 assert_true((cov_sum.ch_names == cov.ch_names))

def test_arithmetic_cov ( ) : cov = read_cov ( cov_fname ) cov_sum = ( cov + cov ) assert_array_almost_equal ( ( 2 * cov . nfree ) , cov_sum . nfree ) assert_array_almost_equal ( ( 2 * cov . data ) , cov_sum . data ) assert_true ( ( cov . ch_names == cov_sum . ch_names ) ) cov += cov assert_array_almost_equal ( cov_sum . nfree , cov . nfree ) assert_array_almost_equal ( cov_sum . data , cov . data ) assert_true ( ( cov_sum . ch_names == cov . ch_names ) )
test arithmetic with noise covariance matrices .