From a9dad95fa71cda668cc15fa44ce853d955769b94 Mon Sep 17 00:00:00 2001 From: jirka <6035284+Borda@users.noreply.github.com> Date: Mon, 2 Feb 2026 09:01:12 +0100 Subject: [PATCH] Convert `supervision/geometry/utils.py` docstrings to doctests --- Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com> --- supervision/geometry/utils.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/supervision/geometry/utils.py b/supervision/geometry/utils.py index 2247adc5..81e1e5d3 100644 --- a/supervision/geometry/utils.py +++ b/supervision/geometry/utils.py @@ -20,14 +20,14 @@ def get_polygon_center(polygon: np.ndarray) -> Point: ValueError: If the polygon has no vertices. Examples: - ```python - import numpy as np - import supervision as sv - - polygon = np.array([[0, 0], [0, 2], [2, 2], [2, 0]]) - sv.get_polygon_center(polygon=polygon) - # Point(x=1, y=1) - ``` + >>> import numpy as np + >>> import supervision as sv + >>> polygon = np.array([[0, 0], [0, 2], [2, 2], [2, 0]]) + >>> center = sv.get_polygon_center(polygon=polygon) + >>> float(center.x) + 1.0 + >>> float(center.y) + 1.0 """ # This is one of the 3 candidate algorithms considered for centroid calculation.