def test_reg_pinv(): """Test regularization and inversion of covariance matrix.""" # create rank-deficient array a = np.array([[1., 0., 1.], [0., 1., 0.], [1., 0., 1.]]) # Test if rank-deficient matrix without regularization throws # specific warning with pytest.warns(RuntimeWarning, match='deficient'): _reg_pinv(a, reg=0.)
def test_reg_pinv(): """Test regularization and inversion of covariance matrix.""" # create rank-deficient array a = np.array([[1., 0., 1.], [0., 1., 0.], [1., 0., 1.]]) # Test if rank-deficient matrix without regularization throws # specific warning with warnings.catch_warnings(record=True) as w: _reg_pinv(a, reg=0.) assert (any('deficient' in str(ww.message) for ww in w))