|
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 |
17 | 12 | from ksuid import KsuidMs
|
18 | 13 | from model import (
|
19 | 14 | BinaryClassificationResult,
|
|
26 | 21 | PaginatedImageQueryList,
|
27 | 22 | )
|
28 | 23 |
|
| 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 | + |
29 | 30 | DEFAULT_CONFIDENCE_THRESHOLD = 0.9
|
30 | 31 | IQ_IMPROVEMENT_THRESHOLD = 0.75
|
31 | 32 |
|
@@ -83,9 +84,9 @@ def test_create_detector(gl: Groundlight):
|
83 | 84 | _detector = gl.create_detector(name=name, query=query)
|
84 | 85 | assert str(_detector)
|
85 | 86 | assert isinstance(_detector, Detector)
|
86 |
| - assert ( |
87 |
| - _detector.confidence_threshold == DEFAULT_CONFIDENCE_THRESHOLD |
88 |
| - ), "We expected the default confidence threshold to be used." |
| 87 | + assert _detector.confidence_threshold == DEFAULT_CONFIDENCE_THRESHOLD, ( |
| 88 | + "We expected the default confidence threshold to be used." |
| 89 | + ) |
89 | 90 |
|
90 | 91 |
|
91 | 92 | def test_create_detector_with_pipeline_config(gl: Groundlight):
|
@@ -149,9 +150,9 @@ def test_create_detector_with_confidence_threshold(gl: Groundlight):
|
149 | 150 |
|
150 | 151 | # If the confidence is not provided, we will use the existing detector's confidence.
|
151 | 152 | retrieved_detector = gl.get_or_create_detector(name=name, query=query)
|
152 |
| - assert ( |
153 |
| - retrieved_detector.confidence_threshold == confidence_threshold |
154 |
| - ), "We expected to retrieve the existing detector's confidence, but got a different value." |
| 153 | + assert retrieved_detector.confidence_threshold == confidence_threshold, ( |
| 154 | + "We expected to retrieve the existing detector's confidence, but got a different value." |
| 155 | + ) |
155 | 156 |
|
156 | 157 |
|
157 | 158 | @pytest.mark.skip_for_edge_endpoint(reason="The edge-endpoint does not support passing detector metadata.")
|
|
0 commit comments