From 0ea3b6625f7d71f6f33a1b323b2a5f60e9ef2dcd Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Sat, 7 Oct 2023 01:52:22 -0700 Subject: [PATCH] add missing end condition --- masque/shapes/arc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/masque/shapes/arc.py b/masque/shapes/arc.py index 2b7046a..e6ce411 100644 --- a/masque/shapes/arc.py +++ b/masque/shapes/arc.py @@ -239,7 +239,7 @@ class Arc(Shape): keep = [] removable = (numpy.cumsum(arc_lengths) <= max_arclen) start = 0 - while True: + while start < arc_lengths.size: next_to_keep = start + numpy.where(removable)[0][-1] # TODO: any chance we haven't sampled finely enough? keep.append(next_to_keep) removable = (numpy.cumsum(arc_lengths[next_to_keep + 1:]) <= max_arclen)