Validation scope: actual mean_vector function only; full package not loaded.
FFF                                                                      [100%]
=================================== FAILURES ===================================
________________ test_bop_mean_vector_target_normalization[b1] _________________

target = 'b1'

    @pytest.mark.parametrize("target", ["b1", "b2", "b3"])
    def test_bop_mean_vector_target_normalization(target):
        # Twenty observations: mean (1, 2, 3, 4, 5)/100, covariance I/475.
        # With the existing sample-covariance convention, eqs. (6)-(8) of
        # Bodnar, Okhrin and Parolya give alpha = 17/57 and the vector below.
        # All three targets are nonzero multiples of the same direction;
        # rescaling that direction must not change beta * target.
        mean = np.arange(1, 6) / 100
        deviations = np.vstack([np.eye(5), -np.eye(5)]) / 10
        returns = pd.DataFrame(
            mean + np.tile(deviations, (2, 1)), columns=list("ABCDE")
        )
        expected = np.array([[137, 154, 171, 188, 205]]) / 5700
    
        result = pe.mean_vector(returns, method="BOP", target=target)
    
        assert result.columns.tolist() == returns.columns.tolist()
>       np.testing.assert_allclose(result.to_numpy(), expected, rtol=1e-12, atol=1e-14)
E       AssertionError: 
E       Not equal to tolerance rtol=1e-12, atol=1e-14
E       
E       Mismatched elements: 5 / 5 (100%)
E       Mismatch at indices:
E        [0, 0]: 0.02020733652312599 (ACTUAL), 0.024035087719298246 (DESIRED)
E        [0, 1]: 0.023189792663476875 (ACTUAL), 0.027017543859649124 (DESIRED)
E        [0, 2]: 0.02617224880382776 (ACTUAL), 0.03 (DESIRED)
E        [0, 3]: 0.02915470494417864 (ACTUAL), 0.03298245614035088 (DESIRED)
E        [0, 4]: 0.03213716108452953 (ACTUAL), 0.035964912280701755 (DESIRED)
E       Max absolute difference among violations: 0.00382775
E       Max relative difference among violations: 0.1592568
E        ACTUAL: array([[0.020207, 0.02319 , 0.026172, 0.029155, 0.032137]])
E        DESIRED: array([[0.024035, 0.027018, 0.03    , 0.032982, 0.035965]])

Riskfolio-Lib/tests/test_mean_vector_bop.py:25: AssertionError
________________ test_bop_mean_vector_target_normalization[b2] _________________

target = 'b2'

    @pytest.mark.parametrize("target", ["b1", "b2", "b3"])
    def test_bop_mean_vector_target_normalization(target):
        # Twenty observations: mean (1, 2, 3, 4, 5)/100, covariance I/475.
        # With the existing sample-covariance convention, eqs. (6)-(8) of
        # Bodnar, Okhrin and Parolya give alpha = 17/57 and the vector below.
        # All three targets are nonzero multiples of the same direction;
        # rescaling that direction must not change beta * target.
        mean = np.arange(1, 6) / 100
        deviations = np.vstack([np.eye(5), -np.eye(5)]) / 10
        returns = pd.DataFrame(
            mean + np.tile(deviations, (2, 1)), columns=list("ABCDE")
        )
        expected = np.array([[137, 154, 171, 188, 205]]) / 5700
    
        result = pe.mean_vector(returns, method="BOP", target=target)
    
        assert result.columns.tolist() == returns.columns.tolist()
>       np.testing.assert_allclose(result.to_numpy(), expected, rtol=1e-12, atol=1e-14)
E       AssertionError: 
E       Not equal to tolerance rtol=1e-12, atol=1e-14
E       
E       Mismatched elements: 5 / 5 (100%)
E       Mismatch at indices:
E        [0, 0]: 0.020207336523126035 (ACTUAL), 0.024035087719298246 (DESIRED)
E        [0, 1]: 0.0231897926634769 (ACTUAL), 0.027017543859649124 (DESIRED)
E        [0, 2]: 0.026172248803827763 (ACTUAL), 0.03 (DESIRED)
E        [0, 3]: 0.029154704944178624 (ACTUAL), 0.03298245614035088 (DESIRED)
E        [0, 4]: 0.03213716108452949 (ACTUAL), 0.035964912280701755 (DESIRED)
E       Max absolute difference among violations: 0.00382775
E       Max relative difference among violations: 0.1592568
E        ACTUAL: array([[0.020207, 0.02319 , 0.026172, 0.029155, 0.032137]])
E        DESIRED: array([[0.024035, 0.027018, 0.03    , 0.032982, 0.035965]])

Riskfolio-Lib/tests/test_mean_vector_bop.py:25: AssertionError
________________ test_bop_mean_vector_target_normalization[b3] _________________

target = 'b3'

    @pytest.mark.parametrize("target", ["b1", "b2", "b3"])
    def test_bop_mean_vector_target_normalization(target):
        # Twenty observations: mean (1, 2, 3, 4, 5)/100, covariance I/475.
        # With the existing sample-covariance convention, eqs. (6)-(8) of
        # Bodnar, Okhrin and Parolya give alpha = 17/57 and the vector below.
        # All three targets are nonzero multiples of the same direction;
        # rescaling that direction must not change beta * target.
        mean = np.arange(1, 6) / 100
        deviations = np.vstack([np.eye(5), -np.eye(5)]) / 10
        returns = pd.DataFrame(
            mean + np.tile(deviations, (2, 1)), columns=list("ABCDE")
        )
        expected = np.array([[137, 154, 171, 188, 205]]) / 5700
    
        result = pe.mean_vector(returns, method="BOP", target=target)
    
        assert result.columns.tolist() == returns.columns.tolist()
>       np.testing.assert_allclose(result.to_numpy(), expected, rtol=1e-12, atol=1e-14)
E       AssertionError: 
E       Not equal to tolerance rtol=1e-12, atol=1e-14
E       
E       Mismatched elements: 5 / 5 (100%)
E       Mismatch at indices:
E        [0, 0]: 0.0029877577348054116 (ACTUAL), 0.024035087719298246 (DESIRED)
E        [0, 1]: 0.005970213875156293 (ACTUAL), 0.027017543859649124 (DESIRED)
E        [0, 2]: 0.008952670015507173 (ACTUAL), 0.03 (DESIRED)
E        [0, 3]: 0.011935126155858051 (ACTUAL), 0.03298245614035088 (DESIRED)
E        [0, 4]: 0.014917582296208933 (ACTUAL), 0.035964912280701755 (DESIRED)
E       Max absolute difference among violations: 0.02104733
E       Max relative difference among violations: 0.87569183
E        ACTUAL: array([[0.002988, 0.00597 , 0.008953, 0.011935, 0.014918]])
E        DESIRED: array([[0.024035, 0.027018, 0.03    , 0.032982, 0.035965]])

Riskfolio-Lib/tests/test_mean_vector_bop.py:25: AssertionError
=========================== short test summary info ============================
FAILED Riskfolio-Lib/tests/test_mean_vector_bop.py::test_bop_mean_vector_target_normalization[b1]
FAILED Riskfolio-Lib/tests/test_mean_vector_bop.py::test_bop_mean_vector_target_normalization[b2]
FAILED Riskfolio-Lib/tests/test_mean_vector_bop.py::test_bop_mean_vector_target_normalization[b3]
3 failed in 0.06s
