Skip to content

Commit 61ee06c

Browse files
fix(pre_commit): 🎨 auto format pre-commit hooks
1 parent 514c435 commit 61ee06c

File tree

4 files changed

+9
-17
lines changed

4 files changed

+9
-17
lines changed

roboflow/adapters/rfapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def save_annotation(
164164
return {"warn": "already annotated"}
165165

166166
if responsejson.get("error"):
167-
raise AnnotationSaveError(responsejson['error'], status_code=response.status_code)
167+
raise AnnotationSaveError(responsejson["error"], status_code=response.status_code)
168168

169169
if not responsejson.get("success"):
170170
raise AnnotationSaveError(responsejson, status_code=response.status_code)

roboflow/core/project.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import json
33
import mimetypes
44
import os
5-
import re
65
import sys
76
import time
87
import warnings
@@ -14,7 +13,6 @@
1413
from roboflow.adapters import rfapi
1514
from roboflow.adapters.rfapi import ImageUploadError
1615
from roboflow.config import API_URL, DEMO_KEYS
17-
from roboflow.core.exceptions import UploadAnnotationError, UploadImageError
1816
from roboflow.core.version import Version
1917
from roboflow.util.general import Retry
2018
from roboflow.util.image_utils import load_labelmap
@@ -554,7 +552,6 @@ def single_upload(
554552
sequence_size=None,
555553
**kwargs,
556554
):
557-
558555
if image_path and image_id:
559556
raise Exception("You can't pass both image_id and image_path")
560557
if not (image_path or image_id):

roboflow/core/workspace.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from PIL import Image
1010

1111
from roboflow.adapters import rfapi
12-
from roboflow.adapters.rfapi import RoboflowError, ImageUploadError, AnnotationSaveError
12+
from roboflow.adapters.rfapi import AnnotationSaveError, ImageUploadError, RoboflowError
1313
from roboflow.config import API_URL, CLIP_FEATURIZE_URL, DEMO_KEYS
1414
from roboflow.core.project import Project
1515
from roboflow.util import folderparser
@@ -310,12 +310,7 @@ def upload_dataset(
310310
location = parsed_dataset["location"]
311311

312312
def _log_img_upload(
313-
image_path,
314-
image,
315-
annotation,
316-
image_upload_time,
317-
image_upload_retry_attempts,
318-
annotation_time
313+
image_path, image, annotation, image_upload_time, image_upload_retry_attempts, annotation_time
319314
):
320315
image_id = image.get("id")
321316
img_success = image.get("success")

tests/test_project.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from roboflow import API_URL
44
from roboflow.config import DEFAULT_BATCH_NAME
5-
from roboflow.core.exceptions import UploadImageError, UploadAnnotationError
6-
from tests import RoboflowTest, PROJECT_NAME, ROBOFLOW_API_KEY
5+
from roboflow.core.exceptions import UploadAnnotationError, UploadImageError
6+
from tests import PROJECT_NAME, ROBOFLOW_API_KEY, RoboflowTest
77

88

99
class TestProject(RoboflowTest):
@@ -60,7 +60,7 @@ def test_upload_raises_upload_image_error_response_200(self):
6060
annotation_path="tests/annotations/valid_annotation.json",
6161
)
6262

63-
self.assertEquals(str(error.exception), "Error uploading image: Invalid Image")
63+
self.assertEqual(str(error.exception), "Error uploading image: Invalid Image")
6464

6565
def test_upload_raises_upload_image_error_response_400(self):
6666
responses.add(
@@ -69,7 +69,7 @@ def test_upload_raises_upload_image_error_response_400(self):
6969
json={
7070
"message": "Invalid Image",
7171
"type": "InvalidImageException",
72-
},
72+
},
7373
status=400,
7474
)
7575

@@ -79,7 +79,7 @@ def test_upload_raises_upload_image_error_response_400(self):
7979
annotation_path="tests/annotations/valid_annotation.json",
8080
)
8181

82-
self.assertEquals(str(error.exception), "Error uploading image: Invalid Image")
82+
self.assertEqual(str(error.exception), "Error uploading image: Invalid Image")
8383

8484
def test_upload_raises_upload_annotation_error(self):
8585
image_id = "hbALkCFdNr9rssgOUXug"
@@ -111,4 +111,4 @@ def test_upload_raises_upload_annotation_error(self):
111111
annotation_path=f"tests/annotations/{image_name}",
112112
)
113113

114-
self.assertEquals(str(error.exception), "Error uploading annotation: Image was already annotated.")
114+
self.assertEqual(str(error.exception), "Error uploading annotation: Image was already annotated.")

0 commit comments

Comments
 (0)