Skip to content

Commit 0f2e45c

Browse files
committed
Remove pairwise for Python 3.9
1 parent 0c01b9b commit 0f2e45c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

mesmerize_core/algorithms/_utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from contextlib import contextmanager
2-
from itertools import pairwise
32
import logging
43
import math
54
import os
@@ -160,12 +159,12 @@ def __call__(self, movie_path: str, dview: Optional[Cluster], var_name_hdf5='mov
160159

161160
# divide movie into chunks of columns
162161
chunk_col_edges = np.linspace(0, dims[1], n_column_chunks+1).astype(int)
163-
chunk_col_slices = [slice(start, end) for start, end in pairwise(chunk_col_edges)]
162+
chunk_col_slices = [slice(start, end) for start, end in zip(chunk_col_edges[:-1], chunk_col_edges[1:])]
164163

165164
if (n_row_chunks := math.ceil(n_chunks / n_column_chunks)) > 1:
166165
# subdivide rows as well
167166
chunk_row_edges = np.linspace(0, dims[0], n_row_chunks+1).astype(int)
168-
chunk_row_slices = [slice(start, end) for start, end in pairwise(chunk_row_edges)]
167+
chunk_row_slices = [slice(start, end) for start, end in zip(chunk_row_edges[:-1], chunk_row_edges[1:])]
169168
else:
170169
chunk_row_slices = [slice(0, dims[0])]
171170

0 commit comments

Comments
 (0)