MCPcopy
hub / github.com/stumpy-dev/stumpy / test_stimp_100_percent

Function test_stimp_100_percent

tests/test_stimp.py:139–182  ·  view source on GitHub ↗
(T)

Source from the content-addressed store, hash-verified

137
138@pytest.mark.parametrize("T", T)
139def test_stimp_100_percent(T):
140 threshold = 0.2
141 percentage = 1.0
142 min_m = 3
143 n = T.shape[0] - min_m + 1
144
145 pan = stimp(
146 T,
147 min_m=min_m,
148 max_m=None,
149 step=1,
150 percentage=percentage,
151 pre_scrump=False,
152 # normalize=True,
153 )
154
155 for i in range(n):
156 pan.update()
157
158 ref_PAN = np.full((pan.M_.shape[0], T.shape[0]), fill_value=np.inf)
159
160 for idx, m in enumerate(pan.M_[:n]):
161 zone = int(np.ceil(m / 4))
162 ref_mp = naive.stump(T, m, T_B=None, exclusion_zone=zone)
163 ref_PAN[pan._bfs_indices[idx], : ref_mp.shape[0]] = ref_mp[:, 0]
164
165 # Compare raw pan
166 cmp_PAN = pan._PAN
167
168 naive.replace_inf(ref_PAN)
169 naive.replace_inf(cmp_PAN)
170
171 npt.assert_almost_equal(ref_PAN, cmp_PAN)
172
173 # Compare transformed pan
174 cmp_pan = pan.PAN_
175 ref_pan = naive.transform_pan(
176 pan._PAN, pan._M, threshold, pan._bfs_indices, pan._n_processed
177 )
178
179 naive.replace_inf(ref_pan)
180 naive.replace_inf(cmp_pan)
181
182 npt.assert_almost_equal(ref_pan, cmp_pan)
183
184
185@pytest.mark.parametrize("T", T)

Callers

nothing calls this directly

Calls 2

stimpClass · 0.90
updateMethod · 0.45

Tested by

no test coverage detected