diff --git a/src/groundlight/client.py b/src/groundlight/client.py index 6a609b73..f0dec53e 100644 --- a/src/groundlight/client.py +++ b/src/groundlight/client.py @@ -200,8 +200,7 @@ def submit_image_query( image_query_dict = raw_image_query.to_dict() image_query = ImageQuery.parse_obj(image_query_dict) else: - # pylint: disable=protected-access - iq_id = self.api_client._submit_image_query_with_inspection( + iq_id = self.api_client.submit_image_query_with_inspection( detector_id=detector_id, image=image_bytesio, inspection_id=inspection_id ) image_query = self.get_image_query(iq_id) @@ -269,20 +268,16 @@ def add_label(self, image_query: Union[ImageQuery, str], label: Union[Label, str def start_inspection(self) -> str: """Starts an inspection report and returns the id of the inspection.""" - # pylint: disable=protected-access - return self.api_client._start_inspection() + return self.api_client.start_inspection() def update_inspection_metadata(self, inspection_id: str, user_provided_key, user_provided_value) -> None: """Add/update inspection metadata with the user_provided_key and user_provided_value.""" - # pylint: disable=protected-access - self.api_client._update_inspection_metadata(inspection_id, user_provided_key, user_provided_value) + self.api_client.update_inspection_metadata(inspection_id, user_provided_key, user_provided_value) def stop_inspection(self, inspection_id: str) -> None: """Stops an inspection and raises an exception if the response from the server does not indicate success.""" - # pylint: disable=protected-access - self.api_client._stop_inspection(inspection_id) + self.api_client.stop_inspection(inspection_id) def update_detector_confidence_threshold(self, detector_id: str, confidence_threshold: float) -> None: """Updates the confidence threshold of a detector given a detector_id.""" - # pylint: disable=protected-access - self.api_client._update_detector_confidence_threshold(detector_id, confidence_threshold) + self.api_client.update_detector_confidence_threshold(detector_id, confidence_threshold) diff --git a/src/groundlight/internalapi.py b/src/groundlight/internalapi.py index a2686d5f..a18a6c91 100644 --- a/src/groundlight/internalapi.py +++ b/src/groundlight/internalapi.py @@ -236,7 +236,7 @@ def _get_detector_by_name(self, name: str) -> Detector: return Detector.parse_obj(parsed["results"][0]) @RequestsRetryDecorator() - def _submit_image_query_with_inspection(self, detector_id: str, image, inspection_id: str) -> str: + def submit_image_query_with_inspection(self, detector_id: str, image, inspection_id: str) -> str: """Submits an image query to the API, and returns the ID of the image query. The image query will be associated to the inspection_id provided. """ @@ -250,7 +250,7 @@ def _submit_image_query_with_inspection(self, detector_id: str, image, inspectio elapsed = 1000 * (time.time() - start_time) logger.debug( - f"Call to ImageQuery._submit_image_query_with_inspection took {elapsed:.1f}ms response={response.text}" + f"Call to ImageQuery.submit_image_query_with_inspection took {elapsed:.1f}ms response={response.text}" ) if not is_ok(response.status_code): @@ -264,7 +264,7 @@ def _submit_image_query_with_inspection(self, detector_id: str, image, inspectio return response.json()["id"] @RequestsRetryDecorator() - def _start_inspection(self) -> str: + def start_inspection(self) -> str: """Starts an inspection, returns the ID.""" url = f"{self.configuration.host}/inspections" @@ -278,7 +278,7 @@ def _start_inspection(self) -> str: return response.json()["id"] @RequestsRetryDecorator() - def _update_inspection_metadata(self, inspection_id: str, user_provided_key, user_provided_value) -> None: + def update_inspection_metadata(self, inspection_id: str, user_provided_key, user_provided_value) -> None: """Add/update inspection metadata with the user_provided_key and user_provided_value. Inspections store metadata in two ways: @@ -326,7 +326,7 @@ def _update_inspection_metadata(self, inspection_id: str, user_provided_key, use ) @RequestsRetryDecorator() - def _stop_inspection(self, inspection_id: str) -> None: + def stop_inspection(self, inspection_id: str) -> None: """Stops an inspection and raises an exception if the response from the server does not indicate success.""" url = f"{self.configuration.host}/inspections/{inspection_id}" @@ -340,7 +340,7 @@ def _stop_inspection(self, inspection_id: str) -> None: raise InspectionError(f"Error stopping inspection {inspection_id}. Status code: {response.status_code}") @RequestsRetryDecorator() - def _update_detector_confidence_threshold(self, detector_id: str, confidence_threshold: float) -> None: + def update_detector_confidence_threshold(self, detector_id: str, confidence_threshold: float) -> None: """Updates the confidence threshold of a detector.""" # The API does not validate the confidence threshold,