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

BUG: TestOnenormest.test_onenormest_table_6_t_1 is failing on my dev branch #17385

Open
Kai-Striega opened this issue Nov 10, 2022 · 3 comments
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.sparse.linalg

Comments

@Kai-Striega
Copy link
Member

Describe your issue.

The TestOnenormest.test_onenormest_table_6_t_1 test is failing on my dev branch. I believe this has not been checked in the CI as it is marked as XSLOW

Reproducing Code Example

`SCIPY_XSLOW=1 python dev.py test -t scipy/sparse/linalg/tests/test_onenormest.py::TestOnenormest::test_onenormest_table_6_t_1`

Error message

Installing, see meson-install.log...
Installation OK
SciPy from development installed path at: /home/kai/Projects/scipy/kai/scipy/build-install/lib/python3.10/site-packages
Running tests for scipy version:1.10.0.dev0+0.699529f, installed at:/home/kai/Projects/scipy/kai/scipy/build-install/lib/python3.10/site-packages/scipy
================================================================================= test session starts ==================================================================================
platform linux -- Python 3.10.6, pytest-7.2.0, pluggy-1.0.0
rootdir: /home/kai/Projects/scipy/kai/scipy, configfile: pytest.ini
plugins: timeout-2.1.0, cov-4.0.0, xdist-3.0.2
collected 1 item                                                                                                                                                                       

scipy/sparse/linalg/tests/test_onenormest.py F                                                                                                                                   [100%]

======================================================================================= FAILURES =======================================================================================
______________________________________________________________________ TestOnenormest.test_onenormest_table_6_t_1 ______________________________________________________________________
scipy/sparse/linalg/tests/test_onenormest.py:183: in test_onenormest_table_6_t_1
    assert_(0.7 < proportion_exact < 0.8)
E   AssertionError
        A          = array([[ 1.0543604 +0.03847635j, -0.33208373-0.22861055j,
         0.40431944+0.0792976j , ..., -0.05681823-0.97139639...     -0.72327521+0.42464523j, ...,  0.86198444+1.35242015j,
        -1.4396941 -0.77624368j, -0.03960976-0.01487513j]])
        A_inv      = array([[0.29119074+0.65104849j, 0.58305885+0.67128938j,
        0.06722355+0.93823077j, ..., 0.6889593 +0.84052724j,
 ...
        0.45835081+0.39487713j, ..., 0.39236538+0.22490301j,
        0.37966209+0.48231849j, 0.52764845+0.90868658j]])
        est        = 286.6717944249084
        expected   = array([ 71.97806709,  70.56821698,  42.24911326, ...,  42.74919002,
        71.59204191, 287.08535285])
        i          = 4999
        itmax      = 5
        max_nresamples = 0
        n          = 100
        nexact     = 2781
        nmult_list = [5, 7, 4, 6, 7, 4, ...]
        nmults     = 4
        nresample_list = [0, 0, 0, 0, 0, 0, ...]
        nresamples = 0
        nsamples   = 5000
        observed   = array([ 71.97806709,  70.56821698,  35.59762277, ...,  42.74919002,
        63.85697738, 286.67179442])
        proportion_exact = 0.5562
        relative_errors = array([0.        , 0.        , 0.15743503, ..., 0.        , 0.10804364,
       0.00144054])
        self       = <scipy.sparse.linalg.tests.test_onenormest.TestOnenormest object at 0x7fb79cad6770>
        t          = 1
        underestimation_ratio = array([1.        , 1.        , 0.84256497, ..., 1.        , 0.89195636,
       0.99855946])
        underestimation_ratio_mean = 0.9414421444954721
        v          = array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
       0., 0., 0., 0., 0., 0., 0., 0., 0., ...0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
       0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
        w          = array([ 1.93101609+4.88613457e-02j,  0.95209743+2.99680743e-01j,
        3.85029705-1.27986728e+00j,  1.89775519+4.326...578313 -9.43259458e-01j,  1.87828784-6.22941868e+00j,
        0.80356713+1.08910034e+00j, -2.96027481+1.61222120e+00j])
=============================================================================== short test summary info ================================================================================
FAILED scipy/sparse/linalg/tests/test_onenormest.py::TestOnenormest::test_onenormest_table_6_t_1 - AssertionError


### SciPy/NumPy/Python version information

1.10.0.dev0+0.699529f, '1.23.4', sys.version_info(major=3, minor=10, micro=6, releaselevel='final', serial=0)
@Kai-Striega Kai-Striega added the defect A clear bug or issue that prevents SciPy from being installed or used as expected label Nov 10, 2022
@WarrenWeckesser
Copy link
Member

This was noted as one of the tests that fails when SCIPY_XSLOW=1 in gh-15384. I currently get 11 failures--including this one--with the latest development branch.

I won't call this a duplicate. gh-15384 is something of a meta-issue, and I think it is reasonable for the individual failures to have their own issues, where the discussion (if any arises) can focus on the specific failure. (See also #16655, which is another failure that occurs when SCIPY_XSLOW=1.)

@WarrenWeckesser
Copy link
Member

This is still occurring in main (dbc2d3a). Is anyone who is somewhat familiar with the code in sparse.linalg interested in taking a look at this?

@WarrenWeckesser
Copy link
Member

Still failing with version '1.14.0.dev0+1021.bd60b4e':

$ SCIPY_XSLOW=1 python3 dev.py test -m full -t scipy.sparse.linalg.tests.test_onenormest -j 6
💻  ninja -C /home/warren/repos/git/forks/scipy/build -j12
ninja: Entering directory `/home/warren/repos/git/forks/scipy/build'
[2/2] Generating scipy/generate-version with a custom command
Build OK
💻  meson install -C build --only-changed
Installing, see meson-install.log...
Installation OK
SciPy from development installed path at: /home/warren/repos/git/forks/scipy/build-install/lib/python3.12/site-packages
Running tests for scipy version:1.14.0.dev0+1021.bd60b4e, installed at:/home/warren/repos/git/forks/scipy/build-install/lib/python3.12/site-packages/scipy
=================================== test session starts ===================================
platform linux -- Python 3.12.3, pytest-8.1.1, pluggy-1.5.0
rootdir: /home/warren/repos/git/forks/scipy
configfile: pytest.ini
plugins: timeout-2.3.1, xdist-3.5.0, hypothesis-6.100.1, cov-5.0.0
6 workers [7 items]     
......F                                                                             [100%]
======================================== FAILURES =========================================
_______________________ TestOnenormest.test_onenormest_table_6_t_1 ________________________
[gw3] linux -- Python 3.12.3 /home/warren/py3.12.3/bin/python3
scipy/sparse/linalg/tests/test_onenormest.py:183: in test_onenormest_table_6_t_1
    assert_(0.7 < proportion_exact < 0.8)
E   AssertionError
        A          = array([[ 1.0543604 +0.03847635j, -0.33208373-0.22861055j,
         0.40431944+0.0792976j , ..., -0.05681823-0.97139639...     -0.72327521+0.42464523j, ...,  0.86198444+1.35242015j,
        -1.4396941 -0.77624368j, -0.03960976-0.01487513j]])
        A_inv      = array([[0.29119074+0.65104849j, 0.58305885+0.67128938j,
        0.06722355+0.93823077j, ..., 0.6889593 +0.84052724j,
 ...
        0.45835081+0.39487713j, ..., 0.39236538+0.22490301j,
        0.37966209+0.48231849j, 0.52764845+0.90868658j]])
        est        = 286.67179442492255
        expected   = array([ 71.97806709,  70.56821698,  42.24911326, ...,  42.74919002,
        71.59204191, 287.08535285])
        i          = 4999
        itmax      = 5
        max_nresamples = 0
        n          = 100
        nexact     = 2781
        nmult_list = [5, 7, 4, 6, 7, 4, ...]
        nmults     = 4
        nresample_list = [0, 0, 0, 0, 0, 0, ...]
        nresamples = 0
        nsamples   = 5000
        observed   = array([ 71.97806709,  70.56821698,  35.59762277, ...,  42.74919002,
        63.85697738, 286.67179442])
        proportion_exact = 0.5562
        relative_errors = array([0.00000000e+00, 0.00000000e+00, 1.57435032e-01, ...,
       3.32423953e-16, 1.08043636e-01, 1.44054171e-03])
        self       = <scipy.sparse.linalg.tests.test_onenormest.TestOnenormest object at 0x73283e1c5c70>
        t          = 1
        underestimation_ratio = array([1.        , 1.        , 0.84256497, ..., 1.        , 0.89195636,
       0.99855946])
        underestimation_ratio_mean = 0.9414421444954721
        v          = array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
       0., 0., 0., 0., 0., 0., 0., 0., 0., ...0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
       0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
        w          = array([ 1.93101609+4.88613457e-02j,  0.95209743+2.99680743e-01j,
        3.85029705-1.27986728e+00j,  1.89775519+4.326...578313 -9.43259458e-01j,  1.87828784-6.22941868e+00j,
        0.80356713+1.08910034e+00j, -2.96027481+1.61222120e+00j])
================================= short test summary info =================================
FAILED scipy/sparse/linalg/tests/test_onenormest.py::TestOnenormest::test_onenormest_table_6_t_1 - AssertionError
=============================== 1 failed, 6 passed in 4.78s ===============================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.sparse.linalg
Projects
None yet
Development

No branches or pull requests

3 participants