Open
Description
This unit test causes a failure:
import numpy as np
import numpy.testing as npt
import naive
from stumpy import stump, config
import pandas as pd
def test_stump_identical_subsequence_self_join():
seed = 27343
np.random.seed(seed)
identical = np.random.rand(8)
T_A = np.random.rand(20)
T_A[1 : 1 + identical.shape[0]] = identical
T_A[11 : 11 + identical.shape[0]] = identical
m = 3
zone = int(np.ceil(m / 4))
ref_mp = naive.stump(T_A, m, exclusion_zone=zone, row_wise=True)
comp_mp = stump(T_A, m, ignore_trivial=True)
naive.replace_inf(ref_mp)
naive.replace_inf(comp_mp)
npt.assert_almost_equal(
ref_mp[:, 0], comp_mp[:, 0], decimal=config.STUMPY_TEST_PRECISION
) # ignore indices
comp_mp = stump(pd.Series(T_A), m, ignore_trivial=True)
naive.replace_inf(comp_mp)
npt.assert_almost_equal(
ref_mp[:, 0], comp_mp[:, 0], decimal=config.STUMPY_TEST_PRECISION
) # ignore indices