|
9 | 9 | from typing import Any, Dict, Optional, Union
|
10 | 10 |
|
11 | 11 | import pytest
|
| 12 | +from groundlight import Groundlight |
| 13 | +from groundlight.binary_labels import VALID_DISPLAY_LABELS, Label, convert_internal_label_to_display |
| 14 | +from groundlight.internalapi import ApiException, InternalApiError, NotFoundError |
| 15 | +from groundlight.optional_imports import * |
| 16 | +from groundlight.status_codes import is_user_error |
12 | 17 | from ksuid import KsuidMs
|
13 | 18 | from model import (
|
14 | 19 | BinaryClassificationResult,
|
|
21 | 26 | PaginatedImageQueryList,
|
22 | 27 | )
|
23 | 28 |
|
24 |
| -from groundlight import Groundlight |
25 |
| -from groundlight.binary_labels import VALID_DISPLAY_LABELS, Label, convert_internal_label_to_display |
26 |
| -from groundlight.internalapi import ApiException, InternalApiError, NotFoundError |
27 |
| -from groundlight.optional_imports import * |
28 |
| -from groundlight.status_codes import is_user_error |
29 |
| - |
30 | 29 | DEFAULT_CONFIDENCE_THRESHOLD = 0.9
|
31 | 30 | IQ_IMPROVEMENT_THRESHOLD = 0.75
|
32 | 31 |
|
@@ -84,9 +83,9 @@ def test_create_detector(gl: Groundlight):
|
84 | 83 | _detector = gl.create_detector(name=name, query=query)
|
85 | 84 | assert str(_detector)
|
86 | 85 | assert isinstance(_detector, Detector)
|
87 |
| - assert _detector.confidence_threshold == DEFAULT_CONFIDENCE_THRESHOLD, ( |
88 |
| - "We expected the default confidence threshold to be used." |
89 |
| - ) |
| 86 | + assert ( |
| 87 | + _detector.confidence_threshold == DEFAULT_CONFIDENCE_THRESHOLD |
| 88 | + ), "We expected the default confidence threshold to be used." |
90 | 89 |
|
91 | 90 |
|
92 | 91 | def test_create_detector_with_pipeline_config(gl: Groundlight):
|
@@ -150,9 +149,9 @@ def test_create_detector_with_confidence_threshold(gl: Groundlight):
|
150 | 149 |
|
151 | 150 | # If the confidence is not provided, we will use the existing detector's confidence.
|
152 | 151 | retrieved_detector = gl.get_or_create_detector(name=name, query=query)
|
153 |
| - assert retrieved_detector.confidence_threshold == confidence_threshold, ( |
154 |
| - "We expected to retrieve the existing detector's confidence, but got a different value." |
155 |
| - ) |
| 152 | + assert ( |
| 153 | + retrieved_detector.confidence_threshold == confidence_threshold |
| 154 | + ), "We expected to retrieve the existing detector's confidence, but got a different value." |
156 | 155 |
|
157 | 156 |
|
158 | 157 | @pytest.mark.skip_for_edge_endpoint(reason="The edge-endpoint does not support passing detector metadata.")
|
|
0 commit comments