Skip to content

Commit 70f2045

Browse files
committed
Update version.py
1 parent 84165ea commit 70f2045

File tree

9 files changed

+60
-63
lines changed

9 files changed

+60
-63
lines changed

src/superannotate/lib/app/interface/base_interface.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ def __init__(self, token: str = None, config_path: str = None):
2626
version = os.environ.get("SA_VERSION", "v1")
2727
_token, _config_path = None, None
2828
_host = os.environ.get("SA_URL", constants.BACKEND_URL)
29-
_ssl_verify = not os.environ.get("SA_SSL", "True").lower() in ("false", "f", "0")
29+
_ssl_verify = not os.environ.get("SA_SSL", "True").lower() in (
30+
"false",
31+
"f",
32+
"0",
33+
)
3034
if token:
3135
_token = Controller.validate_token(token=token)
3236
elif config_path:

src/superannotate/lib/app/interface/sdk_interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1943,7 +1943,7 @@ def search_models(
19431943
task: Optional[NotEmptyStr] = None,
19441944
include_global: Optional[StrictBool] = True,
19451945
):
1946-
"""Search for ML models.
1946+
r"""Search for ML models.
19471947
19481948
:param name: search string
19491949
:type name: str

src/superannotate/lib/core/data_handlers.py

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@
88
from typing import Callable
99
from typing import Dict
1010
from typing import List
11-
from operator import itemgetter
12-
13-
from superannotate_schemas.schemas.classes import AnnotationClass
14-
from superannotate_schemas.schemas.classes import Attribute
15-
from superannotate_schemas.schemas.classes import AttributeGroup
1611

1712
import lib.core as constances
1813
from lib.core.enums import AnnotationTypes
1914
from lib.core.reporter import Reporter
15+
from superannotate_schemas.schemas.classes import AnnotationClass
16+
from superannotate_schemas.schemas.classes import Attribute
17+
from superannotate_schemas.schemas.classes import AttributeGroup
2018

2119

2220
class BaseDataHandler(metaclass=ABCMeta):
@@ -49,7 +47,7 @@ def get_annotation_class(self, name: str) -> AnnotationClass:
4947

5048
@lru_cache()
5149
def get_attribute_group(
52-
self, annotation_class: AnnotationClass, attr_group_name: str
50+
self, annotation_class: AnnotationClass, attr_group_name: str
5351
) -> AttributeGroup:
5452
for attr_group in annotation_class.attribute_groups:
5553
if attr_group.name == attr_group_name:
@@ -116,10 +114,10 @@ def handle(self, annotation: dict):
116114

117115
class MissingIDsHandler(BaseAnnotationDateHandler):
118116
def __init__(
119-
self,
120-
annotation_classes: List[AnnotationClass],
121-
templates: List[dict],
122-
reporter: Reporter,
117+
self,
118+
annotation_classes: List[AnnotationClass],
119+
templates: List[dict],
120+
reporter: Reporter,
123121
):
124122
super().__init__(annotation_classes)
125123
self.validate_existing_classes(annotation_classes)
@@ -189,7 +187,7 @@ def handle(self, annotation: dict):
189187
template["name"]: template["id"] for template in self._templates
190188
}
191189
for annotation_instance in (
192-
i for i in annotation["instances"] if i.get("type", None) == "template"
190+
i for i in annotation["instances"] if i.get("type", None) == "template"
193191
):
194192
annotation_instance["templateId"] = template_name_id_map.get(
195193
annotation_instance.get("templateName", ""), -1
@@ -239,7 +237,13 @@ def handle(self, annotation: dict):
239237

240238

241239
class VideoFormatHandler(BaseAnnotationDateHandler):
242-
INSTANCE_FIELDS = {"pointLabels", "createdBy", "createdAt", "updatedBy", "updatedAt"}
240+
INSTANCE_FIELDS = {
241+
"pointLabels",
242+
"createdBy",
243+
"createdAt",
244+
"updatedBy",
245+
"updatedAt",
246+
}
243247

244248
@staticmethod
245249
def _point_handler(time_stamp):
@@ -270,7 +274,7 @@ def safe_time(timestamp):
270274
return "0" if str(timestamp) == "0.0" else timestamp
271275

272276
def convert_timestamp(timestamp):
273-
return timestamp / 10 ** 6 if timestamp else "0"
277+
return timestamp / 10**6 if timestamp else "0"
274278

275279
editor_data = {
276280
"instances": [],
@@ -368,10 +372,10 @@ def convert_timestamp(timestamp):
368372
(group_name, attr_name)
369373
)
370374
attributes_to_add = (
371-
existing_attributes_in_current_instance - active_attributes
375+
existing_attributes_in_current_instance - active_attributes
372376
)
373377
attributes_to_delete = (
374-
active_attributes - existing_attributes_in_current_instance
378+
active_attributes - existing_attributes_in_current_instance
375379
)
376380
if attributes_to_add or attributes_to_delete:
377381
editor_instance["timeline"][timestamp][

src/superannotate/lib/core/usecases/custom_fields.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111

1212
class CreateCustomSchemaUseCase(BaseReportableUseCase):
1313
def __init__(
14-
self,
15-
reporter: Reporter,
16-
project: ProjectEntity,
17-
schema: dict,
18-
backend_client: SuperannotateServiceProvider,
14+
self,
15+
reporter: Reporter,
16+
project: ProjectEntity,
17+
schema: dict,
18+
backend_client: SuperannotateServiceProvider,
1919
):
2020
super().__init__(reporter)
2121
self._project = project
@@ -43,10 +43,10 @@ def execute(self) -> Response:
4343

4444
class GetCustomSchemaUseCase(BaseReportableUseCase):
4545
def __init__(
46-
self,
47-
reporter: Reporter,
48-
project: ProjectEntity,
49-
backend_client: SuperannotateServiceProvider,
46+
self,
47+
reporter: Reporter,
48+
project: ProjectEntity,
49+
backend_client: SuperannotateServiceProvider,
5050
):
5151
super().__init__(reporter)
5252
self._project = project
@@ -66,11 +66,11 @@ def execute(self) -> Response:
6666

6767
class DeleteCustomSchemaUseCase(BaseReportableUseCase):
6868
def __init__(
69-
self,
70-
reporter: Reporter,
71-
project: ProjectEntity,
72-
fields: List[str],
73-
backend_client: SuperannotateServiceProvider,
69+
self,
70+
reporter: Reporter,
71+
project: ProjectEntity,
72+
fields: List[str],
73+
backend_client: SuperannotateServiceProvider,
7474
):
7575
super().__init__(reporter)
7676
self._project = project
@@ -94,12 +94,12 @@ class UploadCustomValuesUseCase(BaseReportableUseCase):
9494
CHUNK_SIZE = 5000
9595

9696
def __init__(
97-
self,
98-
reporter: Reporter,
99-
project: ProjectEntity,
100-
folder: FolderEntity,
101-
items: List[Dict[str, str]],
102-
backend_client: SuperannotateServiceProvider,
97+
self,
98+
reporter: Reporter,
99+
project: ProjectEntity,
100+
folder: FolderEntity,
101+
items: List[Dict[str, str]],
102+
backend_client: SuperannotateServiceProvider,
103103
):
104104
super().__init__(reporter)
105105
self._project = project
@@ -119,7 +119,7 @@ def execute(self) -> Response:
119119
project_id=self._project.id,
120120
team_id=self._project.team_id,
121121
folder_id=self._folder.uuid,
122-
items=self._items[idx: idx + self.CHUNK_SIZE], # noqa: E203
122+
items=self._items[idx : idx + self.CHUNK_SIZE], # noqa: E203
123123
)
124124
if not response.ok:
125125
self._response.errors = response.error
@@ -142,12 +142,12 @@ class DeleteCustomValuesUseCase(BaseReportableUseCase):
142142
CHUNK_SIZE = 5000
143143

144144
def __init__(
145-
self,
146-
reporter: Reporter,
147-
project: ProjectEntity,
148-
folder: FolderEntity,
149-
items: List[Dict[str, List[str]]],
150-
backend_client: SuperannotateServiceProvider,
145+
self,
146+
reporter: Reporter,
147+
project: ProjectEntity,
148+
folder: FolderEntity,
149+
items: List[Dict[str, List[str]]],
150+
backend_client: SuperannotateServiceProvider,
151151
):
152152
super().__init__(reporter)
153153
self._project = project
@@ -161,7 +161,7 @@ def execute(self) -> Response:
161161
project_id=self._project.id,
162162
team_id=self._project.team_id,
163163
folder_id=self._folder.uuid,
164-
items=self._items[idx: idx + self.CHUNK_SIZE], # noqa: E203
164+
items=self._items[idx : idx + self.CHUNK_SIZE], # noqa: E203
165165
)
166166
if not response.ok:
167167
self._response.errors = response.error

src/superannotate/lib/infrastructure/services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ def get_folder(self, query_string: str):
385385
query_items = query_string.split("&")
386386
params = {}
387387
for item in query_items:
388-
tmp = item.split('=')
388+
tmp = item.split("=")
389389
params[tmp[0]] = tmp[1]
390390

391391
response = self._request(get_folder_url, "get", params=params)

src/superannotate/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "4.4.1dev2"
1+
__version__ = "4.4.1dev3"

tests/integration/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from unittest import TestCase
22

33
from src.superannotate import SAClient
4-
4+
from tests import DATA_SET_PATH
55

66
sa = SAClient()
77

tests/integration/custom_fields/test_custom_schema.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,6 @@ def test_create_schema(self):
2323
data = sa.create_custom_fields(self.PROJECT_NAME, self.PAYLOAD)
2424
self.assertEqual(self.PAYLOAD, data)
2525

26-
def test_(self):
27-
data = sa.create_custom_fields(self.PROJECT_NAME, {
28-
"test": {
29-
"type": "numbaaer"
30-
},
31-
"tester": {
32-
"type": "numbsser"
33-
}}
34-
)
35-
3626
def test_create_limit_25(self):
3727
payload = {i: {"type": "number"} for i in range(26)}
3828
with self.assertRaisesRegexp(

tests/integration/items/test_saqul_query.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
from pathlib import Path
33

44
from src.superannotate import SAClient
5-
from tests.integration.base import BaseTestCase
65
from tests import DATA_SET_PATH
6+
from tests.integration.base import BaseTestCase
77

88
sa = SAClient()
99

@@ -13,14 +13,13 @@ class TestEntitiesSearchVector(BaseTestCase):
1313
PROJECT_DESCRIPTION = "TestEntitiesSearchVector"
1414
PROJECT_TYPE = "Vector"
1515
FOLDER_NAME = "test_folder"
16-
TEST_FOLDER_PATH = "data_set/sample_project_vector"
16+
TEST_FOLDER_PATH = "sample_project_vector"
1717
TEST_QUERY = "instance(type =bbox )"
1818
TEST_INVALID_QUERY = "!instance(type =bbox )!"
1919

20-
2120
@property
2221
def folder_path(self):
23-
return os.path.join(Path(__file__).parent.parent, self.TEST_FOLDER_PATH)
22+
return os.path.join(DATA_SET_PATH, self.TEST_FOLDER_PATH)
2423

2524
def test_query(self):
2625
sa.create_folder(self.PROJECT_NAME, self.FOLDER_NAME)
@@ -40,7 +39,7 @@ def test_query(self):
4039

4140
try:
4241
self.assertRaises(
43-
Exception, sa.query(f"{self.PROJECT_NAME}/{self.FOLDER_NAME}", self.TEST_QUERY, subset="something")
42+
Exception, sa.query(f"{self.PROJECT_NAME}", self.TEST_QUERY, subset="something")
4443
)
4544
except Exception as e:
4645
self.assertEqual(

0 commit comments

Comments
 (0)