Skip to content

Commit 6cfe38f

Browse files
author
brandon
committed
Merge branch 'brandon/counting_formal_release' of github.com:groundlight/python-sdk into brandon/counting_formal_release
2 parents a71f780 + c92e726 commit 6cfe38f

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

src/groundlight/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,9 @@ def create_detector( # noqa: PLR0913
474474
metadata=metadata,
475475
)
476476
else:
477-
raise ValueError(f"Unsupported mode: {mode}, check if your desired mode is only supported in the ExperimentalApi")
477+
raise ValueError(
478+
f"Unsupported mode: {mode}, check if your desired mode is only supported in the ExperimentalApi"
479+
)
478480

479481
def get_or_create_detector( # noqa: PLR0913
480482
self,
@@ -1574,7 +1576,6 @@ def create_binary_detector( # noqa: PLR0913 # pylint: disable=too-many-argument
15741576
obj = self.detectors_api.create_detector(detector_creation_input, _request_timeout=DEFAULT_REQUEST_TIMEOUT)
15751577
return Detector.parse_obj(obj.to_dict())
15761578

1577-
15781579
def create_multiclass_detector( # noqa: PLR0913 # pylint: disable=too-many-arguments, too-many-locals
15791580
self,
15801581
name: str,

test/integration/test_groundlight.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,12 @@ def test_create_detector(gl: Groundlight):
9393
count_detector = gl.create_detector(name=name, query=query, mode=ModeEnum.COUNT, class_names="dog")
9494
assert str(count_detector)
9595
name = f"Test {datetime.utcnow()}" # Need a unique name
96-
multiclass_detector = gl.create_detector(name=name, query=query, mode=ModeEnum.MULTI_CLASS, class_names=["dog", "cat"])
96+
multiclass_detector = gl.create_detector(
97+
name=name, query=query, mode=ModeEnum.MULTI_CLASS, class_names=["dog", "cat"]
98+
)
9799
assert str(multiclass_detector)
98100

101+
99102
def test_create_detector_with_pipeline_config(gl: Groundlight):
100103
# "never-review" is a special model that always returns the same result with 100% confidence.
101104
# It's useful for testing.
@@ -790,6 +793,7 @@ def test_submit_image_query_with_empty_inspection_id(gl: Groundlight, detector:
790793
inspection_id="",
791794
)
792795

796+
793797
def test_binary_detector(gl: Groundlight):
794798
"""
795799
verify that we can create and submit to a binary detector
@@ -800,6 +804,7 @@ def test_binary_detector(gl: Groundlight):
800804
binary_iq = gl.submit_image_query(created_detector, "test/assets/dog.jpeg")
801805
assert binary_iq.result.label is not None
802806

807+
803808
def test_counting_detector(gl: Groundlight):
804809
"""
805810
verify that we can create and submit to a counting detector
@@ -842,4 +847,4 @@ def test_multiclass_detector(gl: Groundlight):
842847
assert created_detector is not None
843848
mc_iq = gl.submit_image_query(created_detector, "test/assets/dog.jpeg")
844849
assert mc_iq.result.label is not None
845-
assert mc_iq.result.label in class_names
850+
assert mc_iq.result.label in class_names

test/unit/test_experimental.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def test_submit_multiple_rois(gl_experimental: ExperimentalApi, image_query_one:
8989
roi = gl_experimental.create_roi(label_name, (0, 0), (0.5, 0.5))
9090
gl_experimental.add_label(image_query_one, 3, [roi] * 3)
9191

92+
9293
def test_text_recognition_detector(gl_experimental: ExperimentalApi):
9394
"""
9495
verify that we can create and submit to a text recognition detector

0 commit comments

Comments
 (0)