Skip to content

Commit a19089b

Browse files
author
Jim Bennett
committed
Linting and formatting
1 parent e9e613b commit a19089b

File tree

8 files changed

+34
-3
lines changed

8 files changed

+34
-3
lines changed

circuitpython_customvision/prediction/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12+
"""
13+
CircuitPython Azure Custom Vision prediction library
14+
"""
15+
1216
from .custom_vision_prediction_client import CustomVisionPredictionClient
1317
from .version import VERSION
1418

circuitpython_customvision/prediction/custom_vision_prediction_client.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
"""
2+
Prediction client for the Azure Custom Vision service
3+
"""
4+
15
import json
26
import time
37
from typing import Optional
@@ -6,7 +10,7 @@
610
from . import models
711

812

9-
def run_request(url, body, headers):
13+
def __run_request(url, body, headers):
1014
retry = 0
1115
r = None
1216

@@ -74,7 +78,7 @@ def __process_image_url(self, route: str, project_id: str, published_name: str,
7478
headers = {"Content-Type": "application/json", "Prediction-Key": self.__api_key}
7579

7680
body = json.dumps({"url": url})
77-
result = run_request(endpoint, body, headers)
81+
result = __run_request(endpoint, body, headers)
7882
result_text = result.text
7983

8084
return models.ImagePrediction(result_text)
@@ -86,7 +90,7 @@ def __process_image(
8690

8791
headers = {"Content-Type": "application/octet-stream", "Prediction-Key": self.__api_key}
8892

89-
result = run_request(endpoint, image_data, headers)
93+
result = __run_request(endpoint, image_data, headers)
9094
result_text = result.text
9195

9296
return models.ImagePrediction(result_text)

circuitpython_customvision/prediction/models/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12+
"""
13+
Models for the predictions made by the Azure Custom Vision service
14+
"""
15+
1216
from .bounding_box import BoundingBox
1317
from .prediction import Prediction
1418
from .image_prediction import ImagePrediction

circuitpython_customvision/prediction/models/bounding_box.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
"""Bounding box that defines a region of an image.
2+
"""
3+
4+
15
class BoundingBox:
26
"""Bounding box that defines a region of an image.
37

circuitpython_customvision/prediction/models/customvision_error.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
"""
2+
An error from the custom vision service
3+
"""
4+
5+
16
class CustomVisionError(Exception):
27
"""
38
An error from the custom vision service

circuitpython_customvision/prediction/models/image_prediction.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
"""Result of an image prediction request.
2+
"""
3+
14
import json
25
from .prediction import Prediction
36
from .bounding_box import BoundingBox

circuitpython_customvision/prediction/models/prediction.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
"""Prediction result.
2+
"""
3+
14
from .bounding_box import BoundingBox
25

36

circuitpython_customvision/prediction/version.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12+
"""
13+
The version of the Custom Vision API to use
14+
"""
15+
1216
VERSION = "3.0"

0 commit comments

Comments
 (0)