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

Function rolling_isconstant

tests/naive.py:18–35  ·  view source on GitHub ↗
(a, w, a_subseq_isconstant=None)

Source from the content-addressed store, hash-verified

16
17
18def rolling_isconstant(a, w, a_subseq_isconstant=None):
19 # a_subseq_isconstant can be numpy.ndarray or function
20 if a_subseq_isconstant is None:
21 a_subseq_isconstant = is_ptp_zero_1d
22
23 custom_func = None
24 if callable(a_subseq_isconstant):
25 custom_func = a_subseq_isconstant
26
27 if custom_func is not None:
28 a_subseq_isconstant = np.logical_and(
29 core.rolling_isfinite(a, w),
30 np.apply_along_axis(
31 lambda a_row, w: custom_func(a_row, w), axis=-1, arr=a, w=w
32 ),
33 )
34
35 return a_subseq_isconstant
36
37
38def rolling_nanstd(a, w):

Callers 12

mass_PIFunction · 0.70
stumpFunction · 0.70
multi_massFunction · 0.70
multi_distance_profileFunction · 0.70
mstumpFunction · 0.70
__init__Method · 0.70
updateMethod · 0.70
ostinatoFunction · 0.70
mpdist_vectFunction · 0.70
get_all_mpdist_profilesFunction · 0.70
prescrumpFunction · 0.70
scrumpFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected