From ebe3fd4d2fa2c0e1b10eb972b1b7b3db625b3514 Mon Sep 17 00:00:00 2001 From: jirka <6035284+Borda@users.noreply.github.com> Date: Mon, 2 Feb 2026 08:30:45 +0100 Subject: [PATCH] Convert `supervision/classification/core.py` docstrings to doctests --- Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com> --- supervision/classification/core.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/supervision/classification/core.py b/supervision/classification/core.py index 184a67fe..86703b2f 100644 --- a/supervision/classification/core.py +++ b/supervision/classification/core.py @@ -167,15 +167,14 @@ class Classifications: the top k class IDs and confidences. Example: - ```python - import supervision as sv - - classifications = sv.Classifications(...) - - classifications.get_top_k(1) - + >>> import numpy as np + >>> import supervision as sv + >>> classifications = sv.Classifications( + ... class_id=np.array([0, 1, 2]), + ... confidence=np.array([0.3, 0.9, 0.5]) + ... ) + >>> classifications.get_top_k(1) (array([1]), array([0.9])) - ``` """ if self.confidence is None: raise ValueError("top_k could not be calculated, confidence is None")