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

Function _get_mask_slices

tests/naive.py:2169–2182  ·  view source on GitHub ↗
(mask)

Source from the content-addressed store, hash-verified

2167
2168
2169def _get_mask_slices(mask):
2170 idx = []
2171
2172 tmp = np.r_[0, mask]
2173 for i, val in enumerate(np.diff(tmp)):
2174 if val == 1:
2175 idx.append(i)
2176 if val == -1:
2177 idx.append(i)
2178
2179 if tmp[-1]:
2180 idx.append(len(mask))
2181
2182 return np.array(idx).reshape(len(idx) // 2, 2)
2183
2184
2185def _total_trapezoid_ndists(a, b, h):

Callers 2

mpdist_snippetsFunction · 0.70
aampdist_snippetsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected