From ceb0a7c79e1ae3d46d09bbac58ee753ca11e8443 Mon Sep 17 00:00:00 2001 From: marcel Date: Wed, 27 Dec 2023 15:13:53 +0100 Subject: [PATCH] use compiled pattern in 'neighbor_indices' properly --- pypsf/neighbors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pypsf/neighbors.py b/pypsf/neighbors.py index 7cb577e..e7c1d2b 100755 --- a/pypsf/neighbors.py +++ b/pypsf/neighbors.py @@ -24,7 +24,7 @@ def neighbor_indices(cluster_labels: np.array, w: int) -> List[int]: pattern = cluster_labels[-w:] p = ''.join(to_char(i) for i in pattern) p = re.compile(p) - matches = re.finditer(p, t) + matches = p.finditer(t) return [match.end() for match in matches]