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

Function test_stimped_ray

tests/test_ray.py:126–170  ·  view source on GitHub ↗
(T, ray_cluster)

Source from the content-addressed store, hash-verified

124@pytest.mark.filterwarnings("ignore:\\s+Port 8787 is already in use:UserWarning")
125@pytest.mark.parametrize("T", T)
126def test_stimped_ray(T, ray_cluster):
127 if not RAY_IMPORTED: # pragma: no cover
128 pytest.skip("Skipping Test Ray Not Installed")
129
130 threshold = 0.2
131 min_m = 3
132 n = T.shape[0] - min_m + 1
133
134 pan = stimped(
135 ray,
136 T,
137 min_m=min_m,
138 max_m=None,
139 step=1,
140 # normalize=True,
141 )
142
143 for i in range(n):
144 pan.update()
145
146 ref_PAN = np.full((pan.M_.shape[0], T.shape[0]), fill_value=np.inf)
147
148 for idx, m in enumerate(pan.M_[:n]):
149 zone = int(np.ceil(m / 4))
150 ref_mp = naive.stump(T, m, T_B=None, exclusion_zone=zone)
151 ref_PAN[pan._bfs_indices[idx], : ref_mp.shape[0]] = ref_mp[:, 0]
152
153 # Compare raw pan
154 cmp_PAN = pan._PAN
155
156 naive.replace_inf(ref_PAN)
157 naive.replace_inf(cmp_PAN)
158
159 npt.assert_almost_equal(ref_PAN, cmp_PAN)
160
161 # Compare transformed pan
162 cmp_pan = pan.PAN_
163 ref_pan = naive.transform_pan(
164 pan._PAN, pan._M, threshold, pan._bfs_indices, pan._n_processed
165 )
166
167 naive.replace_inf(ref_pan)
168 naive.replace_inf(cmp_pan)
169
170 npt.assert_almost_equal(ref_pan, cmp_pan)
171
172
173@pytest.mark.filterwarnings("ignore:numpy.dtype size changed")

Callers

nothing calls this directly

Calls 2

stimpedClass · 0.90
updateMethod · 0.45

Tested by

no test coverage detected