Skip to content

Commit 1f4a389

Browse files
authored
Merge pull request #194 from superannotateai/sdk_fix_logs
Fix logs, annotations upload
2 parents d0f5268 + 00ef0cb commit 1f4a389

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
@@ -2240,7 +2240,7 @@ def execute(self):
22402240
with open(mask_path, "wb") as f:
22412241
f.write(data["annotation_mask"].getbuffer())
22422242
else:
2243-
logger.info(f"There is no blue-map for the image.")
2243+
logger.info("There is no blue-map for the image.")
22442244

22452245
json_path = Path(self._destination) / data["annotation_json_filename"]
22462246
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
@@ -432,7 +432,7 @@ def get_one(self, uuid: int) -> MLModelEntity:
432432
raise NotImplementedError
433433

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

438438
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)