Skip to content

Investigate Failed Test in test_stumpi.py #1163

Description

@NimaSarajpoor
STUMPY_SEED=601565739 pixi run tests custom tests/test_stumpi.py

This test is failing here. It would be good to understand why this is happening.

STUMPY_SEED=601565739 pixi run tests custom tests/test_stumpi.py
============================= test session starts =============================
platform win32 -- Python 3.14.6, pytest-9.1.1, pluggy-1.6.0
rootdir: D:\a\stumpy\stumpy
configfile: pytest.ini
collected 21 items

tests\test_stumpi.py ..............F......                               [100%]

================================== FAILURES ===================================
_____________ test_stumpi_identical_subsequence_self_join_egress ______________

    def test_stumpi_identical_subsequence_self_join_egress():
        m = 3
    
        with rng.fix_state():
            identical = rng.RNG.rand(8)
            T = rng.RNG.rand(20)
            T[1 : 1 + identical.shape[0]] = identical
            T[11 : 11 + identical.shape[0]] = identical
    
            ref_mp = naive.stumpi_egress(T, m)
            ref_P = ref_mp.P_.copy()
            # ref_I = ref_mp.I_
            ref_left_P = ref_mp.left_P_.copy()
            # ref_left_I = ref_mp.left_I_
    
            stream = stumpi(T, m, egress=True)
    
            comp_P = stream.P_.copy()
            # comp_I = stream.I_
            comp_left_P = stream.left_P_.copy()
            # comp_left_I = stream.left_I_
    
            naive.replace_inf(ref_P)
            naive.replace_inf(ref_left_P)
            naive.replace_inf(comp_P)
            naive.replace_inf(comp_left_P)
    
            npt.assert_almost_equal(ref_P, comp_P, decimal=config.STUMPY_TEST_PRECISION)
            # npt.assert_almost_equal(ref_I, comp_I)
>           npt.assert_almost_equal(
                ref_left_P, comp_left_P, decimal=config.STUMPY_TEST_PRECISION
            )
E           AssertionError: 
E           Arrays are not almost equal to 5 decimals
E           
E           Mismatched elements: 1 / 18 (5.56%)
E           Mismatch at index:
E            [16]: 0.0 (ACTUAL), 3.24670007193714e-05 (DESIRED)
E           Max absolute difference among violations: 3.24670007e-05
E           Max relative difference among violations: 1.
E            ACTUAL: array([0.     , 0.     , 3.00411, 1.55421, 1.65445, 1.34523, 0.79075,
E                  1.33512, 0.75008, 0.55743, 0.08145, 0.     , 0.     , 0.     ,
E                  0.     , 0.     , 0.     , 0.50169])
E            DESIRED: mparray([0.00000e+00, 0.00000e+00, 3.00411e+00, 1.55421e+00, 1.65445e+00,
E                    1.34523e+00, 7.90750e-01, 1.33512e+00, 7.50079e-01, 5.57426e-01,
E                    8.14494e-02, 0.00000e+00, 0.00000e+00, 0.00000e+00, 3.65002e-08,
E                    2.88560e-07, 3.24670e-05, 5.01688e-01])

tests\test_stumpi.py:755: AssertionError
======================== 1 failed, 20 passed in 35.67s ========================

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions