From ff148c477e55adbad86584ba824ced655d3dab5a Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Mon, 19 Jan 2026 18:35:48 -0800 Subject: [PATCH] [remove_duplicate_vertices] remove the last vertex rather than the first to better match docs --- masque/utils/vertices.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/masque/utils/vertices.py b/masque/utils/vertices.py index 23fb601..5fddd52 100644 --- a/masque/utils/vertices.py +++ b/masque/utils/vertices.py @@ -18,9 +18,9 @@ def remove_duplicate_vertices(vertices: ArrayLike, closed_path: bool = True) -> `vertices` with no consecutive duplicates. This may be a view into the original array. """ vertices = numpy.asarray(vertices) - duplicates = (vertices == numpy.roll(vertices, 1, axis=0)).all(axis=1) + duplicates = (vertices == numpy.roll(vertices, -1, axis=0)).all(axis=1) if not closed_path: - duplicates[0] = False + duplicates[-1] = False return vertices[~duplicates]