Skip to content

Commit 00ef0cb

Browse files
Vaghinak BasentsyanVaghinak Basentsyan
authored andcommitted
Fix logs, annotations upload
1 parent 97bba85 commit 00ef0cb

File tree

7 files changed

+11
-13
lines changed

7 files changed

+11
-13
lines changed

docs/source/superannotate.sdk.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ _________________
126126
.. autofunction:: superannotate.get_team_metadata
127127
.. autofunction:: superannotate.invite_contributor_to_team
128128
.. autofunction:: superannotate.delete_contributor_to_team_invitation
129+
.. autofunction:: superannotate.search_team_contributors
129130

130131
----------
131132

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
minversion = 3.0
33
log_cli=true
44
python_files = test_*.py
5-
addopts = -n32 --dist=loadscope
5+
;addopts = -n32 --dist=loadscope

src/superannotate/lib/core/usecases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2238,7 +2238,7 @@ def execute(self):
22382238
with open(mask_path, "wb") as f:
22392239
f.write(data["annotation_mask"].getbuffer())
22402240
else:
2241-
logger.info(f"There is no blue-map for the image.")
2241+
logger.info("There is no blue-map for the image.")
22422242

22432243
json_path = Path(self._destination) / data["annotation_json_filename"]
22442244
with open(json_path, "w") as f:

src/superannotate/lib/infrastructure/repositories.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ def get_one(self, uuid: int) -> MLModelEntity:
431431
raise NotImplementedError
432432

433433
def get_all(self, condition: Optional[Condition] = None) -> List[MLModelEntity]:
434-
models = self._service.search_models(condition.build_query())["data"]
434+
models = self._service.search_models(condition.build_query())
435435
return [self.dict2entity(model) for model in models]
436436

437437
def insert(self, entity: MLModelEntity) -> MLModelEntity:

src/superannotate/lib/infrastructure/services.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,7 @@ def get_folders(self, query_string: str = None, params: dict = None):
307307
get_folder_url = urljoin(self.api_url, self.URL_FOLDERS_IMAGES)
308308
if query_string:
309309
get_folder_url = f"{get_folder_url}?{query_string}"
310-
response = self._get_all_pages(
311-
get_folder_url, params=params, key_field="folders"
312-
)
313-
return response
310+
return self._get_all_pages(get_folder_url, params=params, key_field="folders")
314311

315312
def delete_folders(self, project_id: int, team_id: int, folder_ids: List[int]):
316313
delete_folders_url = urljoin(self.api_url, self.URL_DELETE_FOLDERS)
@@ -884,8 +881,8 @@ def search_models(self, query_string: str):
884881
search_model_url = urljoin(self.api_url, self.URL_MODELS)
885882
if query_string:
886883
search_model_url = f"{search_model_url}?{query_string}"
887-
response = self._request(search_model_url, "get",)
888-
return response.json()
884+
# response = self._request(search_model_url, "get",)
885+
return self._get_all_pages(search_model_url)
889886

890887
def bulk_get_folders(self, team_id: int, project_ids: List[int]):
891888
get_folders_url = urljoin(self.api_url, self.URL_BULK_GET_FOLDERS)
1 Byte
Loading

tests/integration/test_basic_images.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ def test_basic_images(self):
2828
sa.upload_images_from_folder_to_project(
2929
self.PROJECT_NAME, self.folder_path, annotation_status="InProgress"
3030
)
31+
sa.create_annotation_classes_from_classes_json(
32+
self.PROJECT_NAME, self.classes_json_path
33+
)
34+
3135
sa.upload_image_annotations(
3236
project=self.PROJECT_NAME,
3337
image_name=self.EXAMPLE_IMAGE_1,
3438
annotation_json=f"{self.folder_path}/{self.EXAMPLE_IMAGE_1}___pixel.json",
3539
)
36-
sa.create_annotation_classes_from_classes_json(
37-
self.PROJECT_NAME, self.classes_json_path
38-
)
39-
4040
downloaded = sa.download_image(
4141
project=self.PROJECT_NAME,
4242
image_name=self.EXAMPLE_IMAGE_1,

0 commit comments

Comments
 (0)