Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: bump tolerance of test_al_mohy_higham_2012_experiment_1 #19376

Merged
merged 1 commit into from Oct 12, 2023

Conversation

rgommers
Copy link
Member

This avoids a test failure that we see in CI in the musllinux job. From this CI log:

_______ TestFractionalMatrixPower.test_al_mohy_higham_2012_experiment_1 ________
scipy/linalg/tests/test_matfuncs.py:565: in test_al_mohy_higham_2012_experiment_1
    assert_array_equal(A_rem_power, A_power)
        A          = array([[3.2346e-01, 3.0000e+04, 3.0000e+04, 3.0000e+04],
       [0.0000e+00, 3.0089e-01, 3.0000e+04, 3.0000e+04],
       [0.0000e+00, 0.0000e+00, 3.2210e-01, 3.0000e+04],
       [0.0000e+00, 0.0000e+00, 0.0000e+00, 3.0744e-01]])
        A_funm_sqrt = array([[ 5.68735439e-01,  2.68511676e+04, -6.35171101e+08,
         3.06962112e+13],
       [ 0.00000000e+00,  5.48534...45e-01,
         2.67376994e+04],
       [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
         5.54472723e-01]])
        A_power    = array([[ 5.68735439e-01,  2.68511676e+04, -6.35171101e+08,
         3.06962112e+13],
       [ 0.00000000e+00,  5.48534...45e-01,
         2.67376994e+04],
       [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
         5.54472723e-01]])
        A_rem_power = array([[ 5.68735439e-01,  2.68511676e+04, -6.35171101e+08,
         3.06962112e+13],
       [ 0.00000000e+00,  5.48534...45e-01,
         2.67376994e+04],
       [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
         5.54472723e-01]])
        A_sqrtm    = array([[ 5.68735439e-01,  2.68511676e+04, -6.35171101e+08,
         3.06962112e+13],
       [ 0.00000000e+00,  5.48534...45e-01,
         2.67376994e+04],
       [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
         5.54472723e-01]])
        info       = 1.7062881045522058e-10
        self       = <scipy.linalg.tests.test_matfuncs.TestFractionalMatrixPower object at 0x7f7f16d59030>
/opt/_internal/cpython-3.10.13/lib/python3.10/contextlib.py:79: in inner
    return func(*args, **kwds)
E   AssertionError:
E   Arrays are not equal
E
E   Mismatched elements: 7 / 16 (43.8%)
E   Max absolute difference: 111.140625
E   Max relative difference: 7.29361661e-12
E    x: array([[ 5.687354e-01,  2.685117e+04, -6.351711e+08,  3.069621e+13],
E          [ 0.000000e+00,  5.485344e-01,  2.687996e+04, -6.515628e+08],
E          [ 0.000000e+00,  0.000000e+00,  5.675385e-01,  2.673770e+04],
E          [ 0.000000e+00,  0.000000e+00,  0.000000e+00,  5.544727e-01]])
E    y: array([[ 5.687354e-01,  2.685117e+04, -6.351711e+08,  3.069621e+13],
E          [ 0.000000e+00,  5.485344e-01,  2.687996e+04, -6.515628e+08],
E          [ 0.000000e+00,  0.000000e+00,  5.675385e-01,  2.673770e+04],
E          [ 0.000000e+00,  0.000000e+00,  0.000000e+00,  5.544727e-01]])

The Cython code being called does a schur decomposition in one branch of the code, so it doesn't seem surprising that exact numerical equality didn't hold forever.

This avoids a test failure that we see in CI in the musllinux job:

```
_______ TestFractionalMatrixPower.test_al_mohy_higham_2012_experiment_1 ________
scipy/linalg/tests/test_matfuncs.py:565: in test_al_mohy_higham_2012_experiment_1
    assert_array_equal(A_rem_power, A_power)
        A          = array([[3.2346e-01, 3.0000e+04, 3.0000e+04, 3.0000e+04],
       [0.0000e+00, 3.0089e-01, 3.0000e+04, 3.0000e+04],
       [0.0000e+00, 0.0000e+00, 3.2210e-01, 3.0000e+04],
       [0.0000e+00, 0.0000e+00, 0.0000e+00, 3.0744e-01]])
        A_funm_sqrt = array([[ 5.68735439e-01,  2.68511676e+04, -6.35171101e+08,
         3.06962112e+13],
       [ 0.00000000e+00,  5.48534...45e-01,
         2.67376994e+04],
       [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
         5.54472723e-01]])
        A_power    = array([[ 5.68735439e-01,  2.68511676e+04, -6.35171101e+08,
         3.06962112e+13],
       [ 0.00000000e+00,  5.48534...45e-01,
         2.67376994e+04],
       [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
         5.54472723e-01]])
        A_rem_power = array([[ 5.68735439e-01,  2.68511676e+04, -6.35171101e+08,
         3.06962112e+13],
       [ 0.00000000e+00,  5.48534...45e-01,
         2.67376994e+04],
       [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
         5.54472723e-01]])
        A_sqrtm    = array([[ 5.68735439e-01,  2.68511676e+04, -6.35171101e+08,
         3.06962112e+13],
       [ 0.00000000e+00,  5.48534...45e-01,
         2.67376994e+04],
       [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
         5.54472723e-01]])
        info       = 1.7062881045522058e-10
        self       = <scipy.linalg.tests.test_matfuncs.TestFractionalMatrixPower object at 0x7f7f16d59030>
/opt/_internal/cpython-3.10.13/lib/python3.10/contextlib.py:79: in inner
    return func(*args, **kwds)
E   AssertionError:
E   Arrays are not equal
E
E   Mismatched elements: 7 / 16 (43.8%)
E   Max absolute difference: 111.140625
E   Max relative difference: 7.29361661e-12
E    x: array([[ 5.687354e-01,  2.685117e+04, -6.351711e+08,  3.069621e+13],
E          [ 0.000000e+00,  5.485344e-01,  2.687996e+04, -6.515628e+08],
E          [ 0.000000e+00,  0.000000e+00,  5.675385e-01,  2.673770e+04],
E          [ 0.000000e+00,  0.000000e+00,  0.000000e+00,  5.544727e-01]])
E    y: array([[ 5.687354e-01,  2.685117e+04, -6.351711e+08,  3.069621e+13],
E          [ 0.000000e+00,  5.485344e-01,  2.687996e+04, -6.515628e+08],
E          [ 0.000000e+00,  0.000000e+00,  5.675385e-01,  2.673770e+04],
E          [ 0.000000e+00,  0.000000e+00,  0.000000e+00,  5.544727e-01]])
```
@rgommers rgommers added scipy.linalg maintenance Items related to regular maintenance tasks labels Oct 12, 2023
@tylerjereddy tylerjereddy added this to the 1.12.0 milestone Oct 12, 2023
Copy link
Contributor

@tylerjereddy tylerjereddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, still a pretty strict tol as well

@tylerjereddy tylerjereddy merged commit 10e6144 into scipy:main Oct 12, 2023
23 checks passed
@rgommers rgommers deleted the fix-ci-failures branch October 12, 2023 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Items related to regular maintenance tasks scipy.linalg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants