(mask)
| 2167 | |
| 2168 | |
| 2169 | def _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 | |
| 2185 | def _total_trapezoid_ndists(a, b, h): |
no outgoing calls
no test coverage detected