superb-ai-onprem 0.3.7__py3-none-any.whl → 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of superb-ai-onprem might be problematic. Click here for more details.
- spb_onprem/__init__.py +4 -0
- spb_onprem/_version.py +2 -2
- spb_onprem/contents/service.py +5 -4
- spb_onprem/data/entities/__init__.py +2 -0
- spb_onprem/data/entities/annotation.py +2 -0
- spb_onprem/data/entities/data.py +2 -0
- spb_onprem/data/entities/data_slice.py +17 -0
- spb_onprem/data/enums/__init__.py +2 -0
- spb_onprem/data/enums/data_slice_status.py +12 -0
- spb_onprem/data/params/__init__.py +50 -22
- spb_onprem/data/params/change_data_labeler.py +23 -0
- spb_onprem/data/params/change_data_reviewer.py +23 -0
- spb_onprem/data/params/change_data_status.py +23 -0
- spb_onprem/data/params/data_list.py +12 -1
- spb_onprem/data/params/delete_slice_annotation_version.py +24 -0
- spb_onprem/data/params/insert_annotation_version.py +13 -6
- spb_onprem/data/params/insert_slice_annotation_version.py +39 -0
- spb_onprem/data/params/update_data_slice.py +23 -0
- spb_onprem/data/params/update_slice_annotation.py +24 -0
- spb_onprem/data/params/update_slice_annotation_version.py +40 -0
- spb_onprem/data/queries.py +234 -18
- spb_onprem/data/service.py +394 -129
- spb_onprem/entities.py +4 -0
- {superb_ai_onprem-0.3.7.dist-info → superb_ai_onprem-0.4.0.dist-info}/METADATA +1 -1
- {superb_ai_onprem-0.3.7.dist-info → superb_ai_onprem-0.4.0.dist-info}/RECORD +28 -18
- {superb_ai_onprem-0.3.7.dist-info → superb_ai_onprem-0.4.0.dist-info}/WHEEL +0 -0
- {superb_ai_onprem-0.3.7.dist-info → superb_ai_onprem-0.4.0.dist-info}/licenses/LICENSE +0 -0
- {superb_ai_onprem-0.3.7.dist-info → superb_ai_onprem-0.4.0.dist-info}/top_level.txt +0 -0
spb_onprem/__init__.py
CHANGED
|
@@ -22,6 +22,7 @@ from .entities import (
|
|
|
22
22
|
DataMeta,
|
|
23
23
|
Dataset,
|
|
24
24
|
Slice,
|
|
25
|
+
DataSlice,
|
|
25
26
|
Activity,
|
|
26
27
|
ActivityHistory,
|
|
27
28
|
Export,
|
|
@@ -32,6 +33,7 @@ from .entities import (
|
|
|
32
33
|
SceneType,
|
|
33
34
|
DataMetaTypes,
|
|
34
35
|
DataMetaValue,
|
|
36
|
+
DataSliceStatus,
|
|
35
37
|
ActivityStatus,
|
|
36
38
|
ActivitySchema,
|
|
37
39
|
SchemaType,
|
|
@@ -70,6 +72,7 @@ __all__ = (
|
|
|
70
72
|
"DataMeta",
|
|
71
73
|
"Dataset",
|
|
72
74
|
"Slice",
|
|
75
|
+
"DataSlice",
|
|
73
76
|
"Activity",
|
|
74
77
|
"ActivityHistory",
|
|
75
78
|
"Export",
|
|
@@ -80,6 +83,7 @@ __all__ = (
|
|
|
80
83
|
"SceneType",
|
|
81
84
|
"DataMetaTypes",
|
|
82
85
|
"DataMetaValue",
|
|
86
|
+
"DataSliceStatus",
|
|
83
87
|
"ActivityStatus",
|
|
84
88
|
"ActivitySchema",
|
|
85
89
|
"SchemaType",
|
spb_onprem/_version.py
CHANGED
spb_onprem/contents/service.py
CHANGED
|
@@ -3,14 +3,14 @@ import requests
|
|
|
3
3
|
import json
|
|
4
4
|
|
|
5
5
|
from io import BytesIO
|
|
6
|
-
from typing import Optional, Union
|
|
6
|
+
from typing import Optional, Tuple, Union
|
|
7
7
|
|
|
8
8
|
from spb_onprem.base_service import BaseService
|
|
9
9
|
from spb_onprem.base_types import (
|
|
10
10
|
Undefined,
|
|
11
11
|
UndefinedType,
|
|
12
12
|
)
|
|
13
|
-
from .entities import BaseContent
|
|
13
|
+
from .entities import BaseContent, Content
|
|
14
14
|
from .queries import Queries
|
|
15
15
|
|
|
16
16
|
|
|
@@ -30,7 +30,7 @@ class ContentService(BaseService):
|
|
|
30
30
|
str,
|
|
31
31
|
UndefinedType
|
|
32
32
|
] = Undefined,
|
|
33
|
-
) -> str:
|
|
33
|
+
) -> Tuple[Content, str]:
|
|
34
34
|
'''
|
|
35
35
|
Creates a new content.
|
|
36
36
|
Args:
|
|
@@ -45,7 +45,8 @@ class ContentService(BaseService):
|
|
|
45
45
|
query=Queries.CREATE,
|
|
46
46
|
variables=Queries.CREATE["variables"](key, content_type)
|
|
47
47
|
)
|
|
48
|
-
|
|
48
|
+
content = Content.model_validate(response['content'])
|
|
49
|
+
return content, response['uploadURL']
|
|
49
50
|
|
|
50
51
|
def upload_content(
|
|
51
52
|
self,
|
|
@@ -3,6 +3,7 @@ from .data_meta import DataMeta
|
|
|
3
3
|
from .data import Data
|
|
4
4
|
from .prediction import Prediction
|
|
5
5
|
from .scene import Scene
|
|
6
|
+
from .data_slice import DataSlice
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
__all__ = (
|
|
@@ -12,4 +13,5 @@ __all__ = (
|
|
|
12
13
|
"AnnotationVersion",
|
|
13
14
|
"Prediction",
|
|
14
15
|
"DataMeta",
|
|
16
|
+
"DataSlice",
|
|
15
17
|
)
|
|
@@ -11,6 +11,8 @@ class AnnotationVersion(CustomBaseModel):
|
|
|
11
11
|
This has the content of the data annotation.
|
|
12
12
|
"""
|
|
13
13
|
id: Optional[str] = None
|
|
14
|
+
channel: Optional[str] = None
|
|
15
|
+
version: Optional[str] = None
|
|
14
16
|
content: Optional[BaseContent] = None
|
|
15
17
|
meta: Optional[dict] = None
|
|
16
18
|
|
spb_onprem/data/entities/data.py
CHANGED
|
@@ -5,6 +5,7 @@ from .scene import Scene
|
|
|
5
5
|
from .annotation import Annotation
|
|
6
6
|
from .prediction import Prediction
|
|
7
7
|
from .data_meta import DataMeta
|
|
8
|
+
from .data_slice import DataSlice
|
|
8
9
|
from spb_onprem.contents.entities import BaseContent
|
|
9
10
|
|
|
10
11
|
class Data(CustomBaseModel):
|
|
@@ -26,3 +27,4 @@ class Data(CustomBaseModel):
|
|
|
26
27
|
created_by: Optional[str] = Field(None, alias="createdBy")
|
|
27
28
|
updated_at: Optional[str] = Field(None, alias="updatedAt")
|
|
28
29
|
updated_by: Optional[str] = Field(None, alias="updatedBy")
|
|
30
|
+
slices: Optional[List[DataSlice]] = None
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from typing import List, Optional, Any
|
|
2
|
+
from spb_onprem.base_model import CustomBaseModel, Field
|
|
3
|
+
from spb_onprem.data.enums.data_slice_status import DataSliceStatus
|
|
4
|
+
from .annotation import Annotation
|
|
5
|
+
|
|
6
|
+
class DataSlice(CustomBaseModel):
|
|
7
|
+
"""
|
|
8
|
+
데이터 슬라이스 정보를 담는 클래스
|
|
9
|
+
"""
|
|
10
|
+
id: Optional[str] = None
|
|
11
|
+
status: Optional[DataSliceStatus] = DataSliceStatus.PENDING
|
|
12
|
+
labeler: Optional[str] = None
|
|
13
|
+
reviewer: Optional[str] = None
|
|
14
|
+
tags: Optional[List[str]] = None
|
|
15
|
+
status_changed_at: Optional[str] = Field(None, alias="statusChangedAt")
|
|
16
|
+
annotation: Optional[Annotation] = None
|
|
17
|
+
meta: Optional[Any] = None
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
from .data_meta_type import DataMetaTypes, DataMetaValue
|
|
2
2
|
from .data_type import DataType
|
|
3
3
|
from .scene_type import SceneType
|
|
4
|
+
from .data_slice_status import DataSliceStatus
|
|
4
5
|
|
|
5
6
|
__all__ = (
|
|
6
7
|
"DataType",
|
|
7
8
|
"SceneType",
|
|
8
9
|
"DataMetaTypes",
|
|
9
10
|
"DataMetaValue",
|
|
11
|
+
"DataSliceStatus",
|
|
10
12
|
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
class DataSliceStatus(str, Enum):
|
|
4
|
+
"""
|
|
5
|
+
데이터 슬라이스의 상태를 나타내는 열거형
|
|
6
|
+
"""
|
|
7
|
+
PENDING = "PENDING"
|
|
8
|
+
REQUEST_LABELING = "REQUEST_LABELING"
|
|
9
|
+
LABELING = "LABELING"
|
|
10
|
+
REVIEWING = "REVIEWING"
|
|
11
|
+
COMPLETED = "COMPLETED"
|
|
12
|
+
REJECTED = "REJECTED"
|
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
from .
|
|
2
|
-
AnnotationFilter,
|
|
3
|
-
DataListFilter,
|
|
4
|
-
DataFilterOptions,
|
|
5
|
-
get_data_id_list_params,
|
|
6
|
-
get_data_list_params,
|
|
7
|
-
)
|
|
8
|
-
from .create_data import (
|
|
1
|
+
from .create import (
|
|
9
2
|
create_params
|
|
10
3
|
)
|
|
11
|
-
from .
|
|
4
|
+
from .update import (
|
|
12
5
|
update_params
|
|
13
6
|
)
|
|
14
|
-
from .
|
|
7
|
+
from .get import (
|
|
15
8
|
get_params
|
|
16
9
|
)
|
|
17
|
-
from .
|
|
18
|
-
|
|
10
|
+
from .get_data_id_list import (
|
|
11
|
+
get_data_id_list_params
|
|
12
|
+
)
|
|
13
|
+
from .get_data_list import (
|
|
14
|
+
get_data_list_params
|
|
19
15
|
)
|
|
20
16
|
from .remove_data_from_slice import (
|
|
21
17
|
remove_data_from_slice_params
|
|
22
18
|
)
|
|
19
|
+
from .insert_data_to_slice import (
|
|
20
|
+
insert_data_to_slice_params
|
|
21
|
+
)
|
|
23
22
|
from .delete_data import (
|
|
24
|
-
delete_data_params
|
|
23
|
+
delete_data_params
|
|
25
24
|
)
|
|
26
25
|
from .insert_prediction import (
|
|
27
|
-
insert_prediction_params
|
|
26
|
+
insert_prediction_params
|
|
28
27
|
)
|
|
29
28
|
from .delete_prediction import (
|
|
30
|
-
delete_prediction_params
|
|
29
|
+
delete_prediction_params
|
|
31
30
|
)
|
|
32
31
|
from .update_annotation import (
|
|
33
|
-
update_annotation_params
|
|
32
|
+
update_annotation_params
|
|
34
33
|
)
|
|
35
34
|
from .insert_annotation_version import (
|
|
36
35
|
insert_annotation_version_params,
|
|
@@ -38,22 +37,51 @@ from .insert_annotation_version import (
|
|
|
38
37
|
from .delete_annotation_version import (
|
|
39
38
|
delete_annotation_version_params,
|
|
40
39
|
)
|
|
40
|
+
from .update_slice_annotation import (
|
|
41
|
+
update_slice_annotation_params,
|
|
42
|
+
)
|
|
43
|
+
from .insert_slice_annotation_version import (
|
|
44
|
+
insert_slice_annotation_version_params,
|
|
45
|
+
)
|
|
46
|
+
from .update_slice_annotation_version import (
|
|
47
|
+
update_slice_annotation_version_params,
|
|
48
|
+
)
|
|
49
|
+
from .delete_slice_annotation_version import (
|
|
50
|
+
delete_slice_annotation_version_params,
|
|
51
|
+
)
|
|
52
|
+
from .change_data_status import (
|
|
53
|
+
change_data_status_params,
|
|
54
|
+
)
|
|
55
|
+
from .change_data_labeler import (
|
|
56
|
+
change_data_labeler_params,
|
|
57
|
+
)
|
|
58
|
+
from .change_data_reviewer import (
|
|
59
|
+
change_data_reviewer_params,
|
|
60
|
+
)
|
|
61
|
+
from .update_data_slice import (
|
|
62
|
+
update_data_slice_params,
|
|
63
|
+
)
|
|
41
64
|
|
|
42
|
-
__all__ =
|
|
43
|
-
"AnnotationFilter",
|
|
44
|
-
"DataListFilter",
|
|
45
|
-
"DataFilterOptions",
|
|
65
|
+
__all__ = [
|
|
46
66
|
"create_params",
|
|
47
67
|
"update_params",
|
|
48
68
|
"get_params",
|
|
49
69
|
"get_data_id_list_params",
|
|
50
70
|
"get_data_list_params",
|
|
51
|
-
"insert_data_to_slice_params",
|
|
52
71
|
"remove_data_from_slice_params",
|
|
72
|
+
"insert_data_to_slice_params",
|
|
53
73
|
"delete_data_params",
|
|
54
74
|
"insert_prediction_params",
|
|
55
75
|
"delete_prediction_params",
|
|
56
76
|
"update_annotation_params",
|
|
57
77
|
"insert_annotation_version_params",
|
|
58
78
|
"delete_annotation_version_params",
|
|
59
|
-
|
|
79
|
+
"update_slice_annotation_params",
|
|
80
|
+
"insert_slice_annotation_version_params",
|
|
81
|
+
"update_slice_annotation_version_params",
|
|
82
|
+
"delete_slice_annotation_version_params",
|
|
83
|
+
"change_data_status_params",
|
|
84
|
+
"change_data_labeler_params",
|
|
85
|
+
"change_data_reviewer_params",
|
|
86
|
+
"update_data_slice_params",
|
|
87
|
+
]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def change_data_labeler_params(
|
|
5
|
+
dataset_id: str,
|
|
6
|
+
data_id: str,
|
|
7
|
+
slice_id: str,
|
|
8
|
+
labeler: Optional[str],
|
|
9
|
+
):
|
|
10
|
+
"""Make the variables for the changeDataLabeler query.
|
|
11
|
+
|
|
12
|
+
Args:
|
|
13
|
+
dataset_id (str): The dataset ID of the data.
|
|
14
|
+
data_id (str): The ID of the data.
|
|
15
|
+
slice_id (str): The slice ID.
|
|
16
|
+
labeler (Optional[str]): The labeler ID. None to unassign.
|
|
17
|
+
"""
|
|
18
|
+
return {
|
|
19
|
+
"dataset_id": dataset_id,
|
|
20
|
+
"data_id": data_id,
|
|
21
|
+
"slice_id": slice_id,
|
|
22
|
+
"labeler": labeler,
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def change_data_reviewer_params(
|
|
5
|
+
dataset_id: str,
|
|
6
|
+
data_id: str,
|
|
7
|
+
slice_id: str,
|
|
8
|
+
reviewer: Optional[str],
|
|
9
|
+
):
|
|
10
|
+
"""Make the variables for the changeDataReviewer query.
|
|
11
|
+
|
|
12
|
+
Args:
|
|
13
|
+
dataset_id (str): The dataset ID of the data.
|
|
14
|
+
data_id (str): The ID of the data.
|
|
15
|
+
slice_id (str): The slice ID.
|
|
16
|
+
reviewer (Optional[str]): The reviewer ID. None to unassign.
|
|
17
|
+
"""
|
|
18
|
+
return {
|
|
19
|
+
"dataset_id": dataset_id,
|
|
20
|
+
"data_id": data_id,
|
|
21
|
+
"slice_id": slice_id,
|
|
22
|
+
"reviewer": reviewer,
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from spb_onprem.data.enums.data_slice_status import DataSliceStatus
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def change_data_status_params(
|
|
5
|
+
dataset_id: str,
|
|
6
|
+
data_id: str,
|
|
7
|
+
slice_id: str,
|
|
8
|
+
status: DataSliceStatus,
|
|
9
|
+
):
|
|
10
|
+
"""Make the variables for the changeDataStatus query.
|
|
11
|
+
|
|
12
|
+
Args:
|
|
13
|
+
dataset_id (str): The dataset ID of the data.
|
|
14
|
+
data_id (str): The ID of the data.
|
|
15
|
+
slice_id (str): The slice ID.
|
|
16
|
+
status (DataSliceStatus): The new status of the data slice.
|
|
17
|
+
"""
|
|
18
|
+
return {
|
|
19
|
+
"dataset_id": dataset_id,
|
|
20
|
+
"data_id": data_id,
|
|
21
|
+
"slice_id": slice_id,
|
|
22
|
+
"status": status.value,
|
|
23
|
+
}
|
|
@@ -8,7 +8,16 @@ from spb_onprem.exceptions import BadParameterError
|
|
|
8
8
|
|
|
9
9
|
class AnnotationFilter(CustomBaseModel):
|
|
10
10
|
type: Optional[str] = None
|
|
11
|
-
|
|
11
|
+
name: Optional[str] = None
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class AnnotationRangeFilter(CustomBaseModel):
|
|
15
|
+
annotation_type: Optional[str] = Field(None, alias="annotationType")
|
|
16
|
+
class_name: Optional[str] = Field(None, alias="className")
|
|
17
|
+
class_count_equals: Optional[int] = Field(None, alias="classCountEquals")
|
|
18
|
+
class_count_in: Optional[List[int]] = Field(None, alias="classCountIn")
|
|
19
|
+
class_count_max: Optional[int] = Field(None, alias="classCountMax")
|
|
20
|
+
class_count_min: Optional[int] = Field(None, alias="classCountMin")
|
|
12
21
|
|
|
13
22
|
|
|
14
23
|
class DataFilterOptions(CustomBaseModel):
|
|
@@ -18,8 +27,10 @@ class DataFilterOptions(CustomBaseModel):
|
|
|
18
27
|
key_contains: Optional[str] = Field(None, alias="keyContains")
|
|
19
28
|
key_matches: Optional[str] = Field(None, alias="keyMatches")
|
|
20
29
|
type_in: Optional[List[DataType]] = Field(None, alias="typeIn")
|
|
30
|
+
annotation_any: Optional[List[AnnotationFilter]] = Field(None, alias="annotationAny")
|
|
21
31
|
annotation_in: Optional[List[AnnotationFilter]] = Field(None, alias="annotationIn")
|
|
22
32
|
annotation_exists: Optional[bool] = Field(None, alias="annotationExists")
|
|
33
|
+
annotation_range: Optional[List[AnnotationRangeFilter]] = Field(None, alias="annotationRange")
|
|
23
34
|
prediction_set_id_in: Optional[List[str]] = Field(None, alias="predictionSetIdIn")
|
|
24
35
|
prediction_set_id_exists: Optional[bool] = Field(None, alias="predictionSetIdExists")
|
|
25
36
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
def delete_slice_annotation_version_params(
|
|
2
|
+
dataset_id: str,
|
|
3
|
+
data_id: str,
|
|
4
|
+
slice_id: str,
|
|
5
|
+
id: str,
|
|
6
|
+
):
|
|
7
|
+
"""Delete slice annotation version from selected data.
|
|
8
|
+
|
|
9
|
+
Args:
|
|
10
|
+
dataset_id (str): dataset id which the data belongs to
|
|
11
|
+
data_id (str): data id to be deleted from
|
|
12
|
+
slice_id (str): slice id of the data
|
|
13
|
+
id (str): annotation version id to be deleted
|
|
14
|
+
|
|
15
|
+
Returns:
|
|
16
|
+
dict: the params for graphql query
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
"dataset_id": dataset_id,
|
|
21
|
+
"data_id": data_id,
|
|
22
|
+
"slice_id": slice_id,
|
|
23
|
+
"id": id,
|
|
24
|
+
}
|
|
@@ -16,14 +16,21 @@ def insert_annotation_version_params(
|
|
|
16
16
|
Returns:
|
|
17
17
|
dict: the params for graphql query
|
|
18
18
|
"""
|
|
19
|
+
version_data = {
|
|
20
|
+
"content": version.content.model_dump(
|
|
21
|
+
by_alias=True, exclude_unset=True
|
|
22
|
+
),
|
|
23
|
+
"meta": version.meta
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
# channel과 version 필드가 있으면 추가
|
|
27
|
+
if version.channel is not None:
|
|
28
|
+
version_data["channel"] = version.channel
|
|
29
|
+
if version.version is not None:
|
|
30
|
+
version_data["version"] = version.version
|
|
19
31
|
|
|
20
32
|
return {
|
|
21
33
|
"dataset_id": dataset_id,
|
|
22
34
|
"data_id": data_id,
|
|
23
|
-
"version":
|
|
24
|
-
"content": version.content.model_dump(
|
|
25
|
-
by_alias=True, exclude_unset=True
|
|
26
|
-
),
|
|
27
|
-
"meta": version.meta
|
|
28
|
-
},
|
|
35
|
+
"version": version_data,
|
|
29
36
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from spb_onprem.data.entities import AnnotationVersion
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def insert_slice_annotation_version_params(
|
|
5
|
+
dataset_id: str,
|
|
6
|
+
data_id: str,
|
|
7
|
+
slice_id: str,
|
|
8
|
+
version: AnnotationVersion,
|
|
9
|
+
):
|
|
10
|
+
"""Insert slice annotation version to selected data.
|
|
11
|
+
|
|
12
|
+
Args:
|
|
13
|
+
dataset_id (str): dataset id which the data belongs to
|
|
14
|
+
data_id (str): data id to be inserted
|
|
15
|
+
slice_id (str): slice id of the data
|
|
16
|
+
version (AnnotationVersion): annotation version to be inserted
|
|
17
|
+
|
|
18
|
+
Returns:
|
|
19
|
+
dict: the params for graphql query
|
|
20
|
+
"""
|
|
21
|
+
version_data = {
|
|
22
|
+
"content": version.content.model_dump(
|
|
23
|
+
by_alias=True, exclude_unset=True
|
|
24
|
+
),
|
|
25
|
+
"meta": version.meta
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
# channel과 version 필드가 있으면 추가
|
|
29
|
+
if version.channel is not None:
|
|
30
|
+
version_data["channel"] = version.channel
|
|
31
|
+
if version.version is not None:
|
|
32
|
+
version_data["version"] = version.version
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
"dataset_id": dataset_id,
|
|
36
|
+
"data_id": data_id,
|
|
37
|
+
"slice_id": slice_id,
|
|
38
|
+
"version": version_data,
|
|
39
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def update_data_slice_params(
|
|
5
|
+
dataset_id: str,
|
|
6
|
+
data_id: str,
|
|
7
|
+
slice_id: str,
|
|
8
|
+
meta: Any,
|
|
9
|
+
):
|
|
10
|
+
"""Make the variables for the updateDataSlice query.
|
|
11
|
+
|
|
12
|
+
Args:
|
|
13
|
+
dataset_id (str): The dataset ID of the data.
|
|
14
|
+
data_id (str): The ID of the data.
|
|
15
|
+
slice_id (str): The slice ID.
|
|
16
|
+
meta (Any): The meta of the data slice.
|
|
17
|
+
"""
|
|
18
|
+
return {
|
|
19
|
+
"dataset_id": dataset_id,
|
|
20
|
+
"data_id": data_id,
|
|
21
|
+
"slice_id": slice_id,
|
|
22
|
+
"meta": meta,
|
|
23
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from typing import Union, Any
|
|
2
|
+
from spb_onprem.base_types import UndefinedType, Undefined
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def update_slice_annotation_params(
|
|
6
|
+
dataset_id: str,
|
|
7
|
+
data_id: str,
|
|
8
|
+
slice_id: str,
|
|
9
|
+
meta: Any,
|
|
10
|
+
):
|
|
11
|
+
"""Make the variables for the updateSliceAnnotation query.
|
|
12
|
+
|
|
13
|
+
Args:
|
|
14
|
+
dataset_id (str): The dataset ID of the data.
|
|
15
|
+
data_id (str): The ID of the data.
|
|
16
|
+
slice_id (str): The slice ID.
|
|
17
|
+
meta (Any): The meta of the slice annotation.
|
|
18
|
+
"""
|
|
19
|
+
return {
|
|
20
|
+
"dataset_id": dataset_id,
|
|
21
|
+
"data_id": data_id,
|
|
22
|
+
"slice_id": slice_id,
|
|
23
|
+
"meta": meta,
|
|
24
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from typing import Union, Optional, Any
|
|
2
|
+
from spb_onprem.base_types import UndefinedType, Undefined
|
|
3
|
+
from spb_onprem.exceptions import BadParameterError
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def update_slice_annotation_version_params(
|
|
7
|
+
dataset_id: str,
|
|
8
|
+
data_id: str,
|
|
9
|
+
slice_id: str,
|
|
10
|
+
id: str,
|
|
11
|
+
channel: Union[str, UndefinedType, None] = Undefined,
|
|
12
|
+
version: Union[str, UndefinedType, None] = Undefined,
|
|
13
|
+
meta: Union[dict, UndefinedType, None] = Undefined,
|
|
14
|
+
):
|
|
15
|
+
"""Make the variables for the updateSliceAnnotationVersion query.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
dataset_id (str): The dataset ID of the data.
|
|
19
|
+
data_id (str): The ID of the data.
|
|
20
|
+
slice_id (str): The slice ID.
|
|
21
|
+
id (str): The annotation version ID.
|
|
22
|
+
channel (str, optional): The channel of the annotation version.
|
|
23
|
+
version (str, optional): The version string of the annotation version.
|
|
24
|
+
meta (dict, optional): The meta of the annotation version.
|
|
25
|
+
"""
|
|
26
|
+
variables = {
|
|
27
|
+
"dataset_id": dataset_id,
|
|
28
|
+
"data_id": data_id,
|
|
29
|
+
"slice_id": slice_id,
|
|
30
|
+
"id": id,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if channel is not Undefined:
|
|
34
|
+
variables["channel"] = channel
|
|
35
|
+
if version is not Undefined:
|
|
36
|
+
variables["version"] = version
|
|
37
|
+
if meta is not Undefined:
|
|
38
|
+
variables["meta"] = meta
|
|
39
|
+
|
|
40
|
+
return variables
|