Skip to content

Commit 6fe9fcf

Browse files
committed
Doc updates
1 parent dd30f75 commit 6fe9fcf

File tree

9 files changed

+172
-131
lines changed

9 files changed

+172
-131
lines changed

docs/source/api_reference/api_metadata.rst

Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -104,43 +104,37 @@ Item metadata example:
104104
.. code-block:: python
105105
106106
{
107-
"name": "example.jpeg",
108-
"path": "project/folder_1/meow.jpeg",
109-
"url": "https://sa-public-files.s3.../text_file_example_1.jpeg",
110-
"annotation_status": "NotStarted",
111-
"annotator_name": None,
112-
"qa_name": None,
113-
"entropy_value": None,
114-
"createdAt": "2022-02-15T20:46:44.000Z",
115-
"updatedAt": "2022-02-15T20:46:44.000Z"
116-
}
117-
118-
----------
119-
120-
121-
Image metadata
122-
_______________
123-
124-
125-
Image metadata example:
126-
127-
.. code-block:: python
128-
129-
{
130-
"name": "000000000001.jpg",
131-
"annotation_status": "Completed",
132-
"annotator_id": None,
133-
"annotator_name": None,
134-
"qa_id": None,
135-
"qa_name": None,
136-
"entropy_value": None,
137-
"approval_status": None,
138-
"createdAt": "2020-08-18T07:30:06.000Z",
139-
"updatedAt": "2020-08-18T07:30:06.000Z"
140-
"is_pinned": 0,
141-
"...": "...",
107+
"createdAt": "2022-09-14T07:06:53.000Z",
108+
"updatedAt": "2022-09-30T13:14:26.000Z",
109+
"id": 33027004,
110+
"name": "5199856037_03d1929b7b_o.jpg",
111+
"path": "New Classes",
112+
"url": "None",
113+
"assignments": [
114+
{
115+
"user_role": "Annotator",
116+
"user_id": "annotator@example.com"
117+
},
118+
{
119+
"user_role": "QA",
120+
"user_id": "qa@example.com"
121+
},
122+
{
123+
"user_role": "reviewer",
124+
"user_id": null
125+
},
126+
{
127+
"user_role": "<role_name",
128+
"user_id": "my@example.com"
129+
}
130+
],
131+
"entropy_value": "None",
132+
"custom_metadata": {
133+
"study_date": "2021-12-31",
134+
"patient_id": "A1234567890",
135+
"medical_specialist": "dr.smith@clinic.com",
136+
}
142137
}
143-
144138
145139
----------
146140

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ minversion = 3.7
33
log_cli=true
44
python_files = test_*.py
55
;pytest_plugins = ['pytest_profiling']
6-
;addopts = -n auto --dist=loadscope
6+
addopts = -n auto --dist=loadscope

src/superannotate/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44

55

6-
__version__ = "4.4.25dev1"
6+
__version__ = "4.4.25dev2"
77

88
os.environ.update({"sa_version": __version__})
99
sys.path.append(os.path.split(os.path.realpath(__file__))[0])

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def upload_images(
8888
project: str,
8989
folder: str,
9090
extensions: str = constances.DEFAULT_IMAGE_EXTENSIONS,
91-
set_annotation_status: str = constances.AnnotationStatus.NOT_STARTED.name,
91+
set_annotation_status: str = None,
9292
exclude_file_patterns=constances.DEFAULT_FILE_EXCLUDE_PATTERNS,
9393
recursive_subfolders=False,
9494
image_quality_in_editor=None,
@@ -243,7 +243,7 @@ def upload_videos(
243243
target_fps=None,
244244
recursive=False,
245245
extensions=constances.DEFAULT_VIDEO_EXTENSIONS,
246-
set_annotation_status=constances.AnnotationStatus.NOT_STARTED.name,
246+
set_annotation_status=None,
247247
start_time=0.0,
248248
end_time=None,
249249
):

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def create_project(
320320
:type workflows: list of dicts
321321
322322
:param workflow: the name of the workflow already created within the team, which must match exactly.
323-
If None, the default “Annotator can’t complete” system workflow will be set.
323+
If None, the default “System workflow” workflow will be set.
324324
:type workflow: str
325325
326326
:param instructions_link: str of instructions URL
@@ -2262,7 +2262,7 @@ def add_contributors_to_project(
22622262
self,
22632263
project: NotEmptyStr,
22642264
emails: conlist(EmailStr, min_items=1),
2265-
role: ANNOTATOR_ROLE,
2265+
role: str,
22662266
) -> Tuple[List[str], List[str]]:
22672267
"""Add contributors to project.
22682268
@@ -2318,7 +2318,7 @@ def invite_contributors_to_team(
23182318

23192319
def get_annotations(
23202320
self,
2321-
project: Union[NotEmptyStr, int],
2321+
project: Union[int, NotEmptyStr],
23222322
items: Optional[Union[List[NotEmptyStr], List[int]]] = None,
23232323
):
23242324
"""Returns annotations for the given list of items.
@@ -2663,8 +2663,8 @@ def search_items(
26632663

26642664
def list_items(
26652665
self,
2666-
project: Union[str, int],
2667-
folder: Optional[Union[str, int]] = None,
2666+
project: Union[int, str],
2667+
folder: Optional[Union[int, str]] = None,
26682668
*,
26692669
include: List[Literal["assignments", "custom_metadata"]] = None,
26702670
**filters,
@@ -2674,12 +2674,12 @@ def list_items(
26742674
26752675
:param project: The project name, project ID, or folder path (e.g., "project1/folder1") to search within.
26762676
This can refer to the root of the project or a specific subfolder.
2677-
:type project: Union[str, int]
2677+
:type project: Union[int, str]
26782678
26792679
:param folder: The folder name or ID to search within. If None, the search will be done in the root folder of
26802680
the project. If both “project” and “folder” specify folders, the “project”
26812681
value will take priority.
2682-
:type folder: Union[str, int], optional
2682+
:type folder: Union[int, str], optional
26832683
26842684
:param include: Specifies additional fields to include in the response.
26852685
@@ -2771,15 +2771,17 @@ def list_items(
27712771
)
27722772
"""
27732773
project = (
2774-
project
2774+
self.controller.get_project_by_id(project).data
27752775
if isinstance(project, int)
27762776
else self.controller.get_project(project)
27772777
)
27782778
if folder is None:
27792779
folder = self.controller.get_folder(project, "root")
27802780
else:
27812781
if isinstance(folder, int):
2782-
folder = self.controller.get_folder_by_id(project.id, folder)
2782+
folder = self.controller.get_folder_by_id(
2783+
project_id=project.id, folder_id=folder
2784+
).data
27832785
else:
27842786
folder = self.controller.get_folder(project, folder)
27852787
include = include or []

src/superannotate/lib/infrastructure/controller.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from typing import List
99
from typing import Optional
1010
from typing import Tuple
11-
from typing import TypedDict
1211
from typing import Union
1312

1413
import lib.core as constances
@@ -45,6 +44,8 @@
4544
from lib.infrastructure.services.http_client import HttpClient
4645
from lib.infrastructure.utils import divide_to_chunks
4746
from lib.infrastructure.utils import extract_project_folder
47+
from typing_extensions import TypedDict
48+
from typing_extensions import Unpack
4849

4950

5051
class ItemFilters(TypedDict, total=False):
@@ -58,15 +59,15 @@ class ItemFilters(TypedDict, total=False):
5859
annotation_status: Optional[str]
5960
annotation_status__in: Optional[List[str]]
6061
approval_status: Optional[str]
61-
approval_status__in: Optional[str]
62+
approval_status__in: Optional[List[str]]
6263
approval_status__ne: Optional[str]
6364
assignments__user_id: Optional[str]
6465
assignments__user_id__in: Optional[List[str]]
6566
assignments__user_id__ne: Optional[str]
6667
assignments__user_role: Optional[str]
67-
assignments__user_role__in: Optional[str]
68+
assignments__user_role__in: Optional[List[str]]
6869
assignments__user_role__ne: Optional[str]
69-
assignments__user_role__notin: Optional[str]
70+
assignments__user_role__notin: Optional[List[str]]
7071

7172

7273
def build_condition(**kwargs) -> Condition:
@@ -485,7 +486,7 @@ def list_items(
485486
folder: FolderEntity,
486487
/,
487488
include: List[str] = None,
488-
**filters,
489+
**filters: Unpack[ItemFilters],
489490
) -> List[BaseItemEntity]:
490491

491492
query = self._build_query(project, filters, include)

0 commit comments

Comments
 (0)