From 723944018ef1247ae642ba11e835e38f94ea0b17 Mon Sep 17 00:00:00 2001 From: jan Date: Wed, 6 Sep 2017 21:03:39 -0700 Subject: [PATCH] add documentation to Polygon.cut() --- masque/shapes/polygon.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/masque/shapes/polygon.py b/masque/shapes/polygon.py index 419809d..b341535 100644 --- a/masque/shapes/polygon.py +++ b/masque/shapes/polygon.py @@ -177,6 +177,14 @@ class Polygon(Shape): cut_xs: numpy.ndarray = None, cut_ys: numpy.ndarray = None ) -> List['Polygon']: + """ + Decomposes the polygon into a list of constituents by cutting along the + specified x and/or y coordinates. + + :param cut_xs: list of x-coordinates to cut along (e.g., [1, 1.4, 6]) + :param cut_ys: list of y-coordinates to cut along (e.g., [1, 3, 5.4]) + :return: List of Polygon objects + """ import float_raster xy = (self.offset + self.vertices).T