dtlpy 1.73.8__py3-none-any.whl → 1.74.14__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.
- dtlpy/__init__.py +47 -38
- dtlpy/__version__.py +1 -1
- dtlpy/assets/__pycache__/__init__.cpython-311.pyc +0 -0
- dtlpy/entities/__init__.py +1 -1
- dtlpy/entities/annotation.py +7 -0
- dtlpy/entities/annotation_definitions/note.py +1 -3
- dtlpy/entities/app.py +4 -3
- dtlpy/entities/command.py +3 -2
- dtlpy/entities/dataset.py +4 -3
- dtlpy/entities/dpk.py +3 -2
- dtlpy/entities/driver.py +4 -2
- dtlpy/entities/execution.py +3 -2
- dtlpy/entities/feature.py +6 -4
- dtlpy/entities/feature_set.py +4 -3
- dtlpy/entities/integration.py +4 -3
- dtlpy/entities/item.py +5 -3
- dtlpy/entities/model.py +3 -2
- dtlpy/entities/node.py +7 -1
- dtlpy/entities/ontology.py +5 -5
- dtlpy/entities/organization.py +3 -2
- dtlpy/entities/package.py +3 -2
- dtlpy/entities/paged_entities.py +4 -3
- dtlpy/entities/pipeline.py +4 -3
- dtlpy/entities/pipeline_execution.py +6 -3
- dtlpy/entities/project.py +3 -2
- dtlpy/entities/recipe.py +6 -5
- dtlpy/entities/resource_execution.py +3 -3
- dtlpy/entities/service.py +31 -6
- dtlpy/entities/trigger.py +3 -2
- dtlpy/entities/webhook.py +4 -3
- dtlpy/ml/base_model_adapter.py +10 -8
- dtlpy/new_instance.py +2 -1
- dtlpy/repositories/analytics.py +3 -3
- dtlpy/repositories/annotations.py +3 -2
- dtlpy/repositories/apps.py +3 -2
- dtlpy/repositories/artifacts.py +3 -2
- dtlpy/repositories/assignments.py +3 -2
- dtlpy/repositories/bots.py +3 -2
- dtlpy/repositories/codebases.py +5 -3
- dtlpy/repositories/commands.py +6 -5
- dtlpy/repositories/datasets.py +3 -1
- dtlpy/repositories/dpks.py +2 -1
- dtlpy/repositories/drivers.py +4 -3
- dtlpy/repositories/executions.py +3 -2
- dtlpy/repositories/feature_sets.py +3 -2
- dtlpy/repositories/features.py +4 -5
- dtlpy/repositories/integrations.py +3 -2
- dtlpy/repositories/items.py +3 -2
- dtlpy/repositories/models.py +6 -4
- dtlpy/repositories/nodes.py +3 -2
- dtlpy/repositories/ontologies.py +3 -3
- dtlpy/repositories/organizations.py +3 -3
- dtlpy/repositories/packages.py +16 -13
- dtlpy/repositories/pipeline_executions.py +2 -1
- dtlpy/repositories/pipelines.py +3 -2
- dtlpy/repositories/projects.py +3 -2
- dtlpy/repositories/recipes.py +3 -2
- dtlpy/repositories/resource_executions.py +3 -2
- dtlpy/repositories/tasks.py +3 -2
- dtlpy/repositories/times_series.py +3 -2
- dtlpy/repositories/triggers.py +3 -2
- dtlpy/repositories/uploader.py +1 -1
- dtlpy/repositories/webhooks.py +3 -2
- dtlpy/services/__init__.py +0 -1
- dtlpy/services/api_client.py +5 -3
- dtlpy/utilities/converter.py +1 -1
- dtlpy/utilities/dataset_generators/dataset_generator.py +1 -1
- {dtlpy-1.73.8.dist-info → dtlpy-1.74.14.dist-info}/METADATA +1 -1
- {dtlpy-1.73.8.dist-info → dtlpy-1.74.14.dist-info}/RECORD +77 -76
- tests/features/environment.py +27 -2
- {dtlpy-1.73.8.data → dtlpy-1.74.14.data}/scripts/dlp +0 -0
- {dtlpy-1.73.8.data → dtlpy-1.74.14.data}/scripts/dlp.bat +0 -0
- {dtlpy-1.73.8.data → dtlpy-1.74.14.data}/scripts/dlp.py +0 -0
- {dtlpy-1.73.8.dist-info → dtlpy-1.74.14.dist-info}/LICENSE +0 -0
- {dtlpy-1.73.8.dist-info → dtlpy-1.74.14.dist-info}/WHEEL +0 -0
- {dtlpy-1.73.8.dist-info → dtlpy-1.74.14.dist-info}/entry_points.txt +0 -0
- {dtlpy-1.73.8.dist-info → dtlpy-1.74.14.dist-info}/top_level.txt +0 -0
dtlpy/__init__.py
CHANGED
|
@@ -13,24 +13,61 @@
|
|
|
13
13
|
#
|
|
14
14
|
# You should have received a copy of the GNU General Public License
|
|
15
15
|
# along with DTLPY. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
import warnings
|
|
16
17
|
import logging
|
|
17
18
|
import sys
|
|
18
19
|
import os
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
##########
|
|
22
|
+
# Logger #
|
|
23
|
+
##########
|
|
24
|
+
from .services import DataloopLogger, DtlpyFilter
|
|
25
|
+
from .__version__ import version as __version__
|
|
26
|
+
|
|
27
|
+
logger = logging.getLogger(name='dtlpy')
|
|
28
|
+
logging.getLogger(name='filelock').setLevel(level=logging.CRITICAL)
|
|
29
|
+
if len(logger.handlers) == 0:
|
|
30
|
+
logger.setLevel(logging.DEBUG)
|
|
31
|
+
log_filepath = DataloopLogger.get_log_filepath()
|
|
32
|
+
# set file handler to save all logs to file
|
|
33
|
+
stream_formatter = logging.Formatter(
|
|
34
|
+
fmt="[%(asctime)-s][%(levelname).3s][%(name)s:v" + __version__ + "][%(relativepath)-s:%(lineno)-d] %(message)s",
|
|
35
|
+
datefmt="%Y-%m-%d %H:%M:%S",
|
|
36
|
+
)
|
|
37
|
+
file_formatter = logging.Formatter(
|
|
38
|
+
fmt="[%(asctime)s.%(msecs)03d][%(threadName)s][%(levelname).3s][%(name)s:v" + __version__ + "][%(relativepath)-s:%(lineno)-d](%(funcName)-s): %(message)s",
|
|
39
|
+
datefmt="%Y-%m-%d %H:%M:%S",
|
|
40
|
+
)
|
|
41
|
+
package_path = os.path.dirname(__file__)
|
|
42
|
+
# relative function path filtering
|
|
43
|
+
filtering = DtlpyFilter(package_path)
|
|
44
|
+
fh = DataloopLogger(log_filepath, maxBytes=(1048 * 1000 * 5))
|
|
45
|
+
fh.setLevel(logging.DEBUG)
|
|
46
|
+
fh.setFormatter(file_formatter)
|
|
47
|
+
fh.addFilter(filtering)
|
|
48
|
+
sh = logging.StreamHandler()
|
|
49
|
+
sh.setLevel(logging.WARNING)
|
|
50
|
+
sh.setFormatter(stream_formatter)
|
|
51
|
+
sh.addFilter(filtering)
|
|
52
|
+
# set handlers to main logger
|
|
53
|
+
logger.addHandler(sh)
|
|
54
|
+
logger.addHandler(fh)
|
|
55
|
+
|
|
56
|
+
from .services.api_client import client as client_api
|
|
57
|
+
from .services.api_client import VerboseLoggingLevel, ApiClient
|
|
58
|
+
from .services import DataloopLogger, DtlpyFilter, check_sdk, Reporter, service_defaults
|
|
22
59
|
from .services.api_reference import api_reference as _api_reference
|
|
23
60
|
from .caches.cache import CacheConfig, CacheType
|
|
24
61
|
from .exceptions import PlatformException
|
|
25
62
|
from . import repositories, exceptions, entities, examples
|
|
26
|
-
from .__version__ import version as __version__
|
|
27
63
|
from .entities import (
|
|
28
64
|
# main entities
|
|
29
65
|
Project, Dataset, ExpirationOptions, ExportVersion, Trigger, Item, Execution, AnnotationCollection, Annotation,
|
|
30
66
|
Recipe, IndexDriver, AttributesTypes, AttributesRange, Dpk, App,
|
|
31
67
|
Ontology, Label, Task, TaskPriority, Assignment, Service, Package, Codebase, Model, PackageModule, PackageFunction,
|
|
32
68
|
# annotations
|
|
33
|
-
Box, Cube, Cube3d, Point, Note, Message, Segmentation, Ellipse, Classification, Subtitle, Polyline, Pose,
|
|
69
|
+
Box, Cube, Cube3d, Point, Note, Message, Segmentation, Ellipse, Classification, Subtitle, Polyline, Pose,
|
|
70
|
+
Description,
|
|
34
71
|
Polygon, Text,
|
|
35
72
|
# filters
|
|
36
73
|
Filters, FiltersKnownFields, FiltersResource, FiltersOperations, FiltersMethod, FiltersOrderByDirection,
|
|
@@ -39,7 +76,7 @@ from .entities import (
|
|
|
39
76
|
TriggerResource, TriggerAction, TriggerExecutionMode, TriggerType,
|
|
40
77
|
# faas
|
|
41
78
|
FunctionIO, KubernetesAutuscalerType, KubernetesRabbitmqAutoscaler, KubernetesAutoscaler, KubernetesRuntime,
|
|
42
|
-
InstanceCatalog, PackageInputType, ServiceType,
|
|
79
|
+
InstanceCatalog, PackageInputType, ServiceType, ServiceModeType,
|
|
43
80
|
PackageSlot, SlotPostAction, SlotPostActionType, SlotDisplayScope, SlotDisplayScopeResource, UiBindingPanel,
|
|
44
81
|
# roberto
|
|
45
82
|
DatasetSubsetType, LogSample, ArtifactType, Artifact, ItemArtifact, LinkArtifact, LocalArtifact, EntityScopeLevel,
|
|
@@ -66,7 +103,6 @@ from .entities import (
|
|
|
66
103
|
from .ml import BaseModelAdapter
|
|
67
104
|
from .utilities import Converter, BaseServiceRunner, Progress, Context, AnnotationFormat
|
|
68
105
|
from .repositories import FUNCTION_END_LINE, PackageCatalog
|
|
69
|
-
import warnings
|
|
70
106
|
|
|
71
107
|
warnings.simplefilter('once', DeprecationWarning)
|
|
72
108
|
|
|
@@ -88,43 +124,11 @@ if os.name == "nt":
|
|
|
88
124
|
"""
|
|
89
125
|
Main Platform Interface module for Dataloop
|
|
90
126
|
"""
|
|
91
|
-
##########
|
|
92
|
-
# Logger #
|
|
93
|
-
##########
|
|
94
|
-
logger = logging.getLogger(name='dtlpy')
|
|
95
|
-
logging.getLogger(name='filelock').setLevel(level=logging.CRITICAL)
|
|
96
|
-
if len(logger.handlers) == 0:
|
|
97
|
-
logger.setLevel(logging.DEBUG)
|
|
98
|
-
log_filepath = DataloopLogger.get_log_filepath()
|
|
99
|
-
# set file handler to save all logs to file
|
|
100
|
-
stream_formatter = logging.Formatter(
|
|
101
|
-
fmt="[%(asctime)-s][%(levelname).3s][%(name)s:v" + __version__ + "][%(relativepath)-s:%(lineno)-d] %(message)s",
|
|
102
|
-
datefmt="%Y-%m-%d %H:%M:%S",
|
|
103
|
-
)
|
|
104
|
-
file_formatter = logging.Formatter(
|
|
105
|
-
fmt="[%(asctime)s.%(msecs)03d][%(threadName)s][%(levelname).3s][%(name)s:v" + __version__ + "][%(relativepath)-s:%(lineno)-d](%(funcName)-s): %(message)s",
|
|
106
|
-
datefmt="%Y-%m-%d %H:%M:%S",
|
|
107
|
-
)
|
|
108
|
-
package_path = os.path.dirname(__file__)
|
|
109
|
-
# relative function path filtering
|
|
110
|
-
filtering = DtlpyFilter(package_path)
|
|
111
|
-
fh = DataloopLogger(log_filepath, maxBytes=(1048 * 1000 * 5))
|
|
112
|
-
fh.setLevel(logging.DEBUG)
|
|
113
|
-
fh.setFormatter(file_formatter)
|
|
114
|
-
fh.addFilter(filtering)
|
|
115
|
-
sh = logging.StreamHandler()
|
|
116
|
-
sh.setLevel(logging.WARNING)
|
|
117
|
-
sh.setFormatter(stream_formatter)
|
|
118
|
-
sh.addFilter(filtering)
|
|
119
|
-
# set handlers to main logger
|
|
120
|
-
logger.addHandler(sh)
|
|
121
|
-
logger.addHandler(fh)
|
|
122
127
|
|
|
123
128
|
################
|
|
124
129
|
# Repositories #
|
|
125
130
|
################
|
|
126
131
|
# Create repositories instances
|
|
127
|
-
client_api = ApiClient()
|
|
128
132
|
projects = repositories.Projects(client_api=client_api)
|
|
129
133
|
datasets = repositories.Datasets(client_api=client_api, project=None)
|
|
130
134
|
items = repositories.Items(client_api=client_api, datasets=datasets)
|
|
@@ -472,3 +476,8 @@ ATTRIBUTES_TYPES_FREE_TEXT = AttributesTypes.FREE_TEXT
|
|
|
472
476
|
TASK_PRIORITY_LOW = TaskPriority.LOW
|
|
473
477
|
TASK_PRIORITY_MEDIUM = TaskPriority.MEDIUM
|
|
474
478
|
TASK_PRIORITY_HIGH = TaskPriority.HIGH
|
|
479
|
+
|
|
480
|
+
SERVICE_MODE_TYPE_REGULAR = ServiceModeType.REGULAR
|
|
481
|
+
SERVICE_MODE_TYPE_DEBUG = ServiceModeType.DEBUG
|
|
482
|
+
|
|
483
|
+
|
dtlpy/__version__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
version = '1.
|
|
1
|
+
version = '1.74.14'
|
|
Binary file
|
dtlpy/entities/__init__.py
CHANGED
|
@@ -44,7 +44,7 @@ from .package_slot import PackageSlot, SlotPostAction, SlotPostActionType, SlotD
|
|
|
44
44
|
from .package_function import PackageFunction, FunctionIO, PackageInputType
|
|
45
45
|
from .time_series import TimeSeries
|
|
46
46
|
from .service import Service, KubernetesAutuscalerType, KubernetesRabbitmqAutoscaler, KubernetesAutoscaler, \
|
|
47
|
-
InstanceCatalog, KubernetesRuntime, ServiceType
|
|
47
|
+
InstanceCatalog, KubernetesRuntime, ServiceType, ServiceModeType
|
|
48
48
|
from .execution import Execution, ExecutionStatus
|
|
49
49
|
from .command import Command, CommandsStatus
|
|
50
50
|
from .assignment import Assignment, Workload, WorkloadUnit
|
dtlpy/entities/annotation.py
CHANGED
|
@@ -1216,6 +1216,13 @@ class Annotation(entities.BaseEntity):
|
|
|
1216
1216
|
annotation=self)
|
|
1217
1217
|
|
|
1218
1218
|
self.frames[frame_num] = frame
|
|
1219
|
+
if not self.frames[frame_num].fixed and self.start_frame < frame_num:
|
|
1220
|
+
frame_last = self.frames[frame_num - 1].to_snapshot()
|
|
1221
|
+
frame_current = self.frames[frame_num].to_snapshot()
|
|
1222
|
+
frame_last.pop('frame')
|
|
1223
|
+
frame_current.pop('frame')
|
|
1224
|
+
if frame_last == frame_current:
|
|
1225
|
+
self.frames[frame_num]._interpolation = True
|
|
1219
1226
|
self.end_frame = max(self.last_frame, frame_num)
|
|
1220
1227
|
self.end_time = self.end_frame / self.fps
|
|
1221
1228
|
|
|
@@ -2,7 +2,7 @@ import numpy as np
|
|
|
2
2
|
import time
|
|
3
3
|
|
|
4
4
|
from . import Box
|
|
5
|
-
from ...services import
|
|
5
|
+
from ...services.api_client import client as api_client
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class Note(Box):
|
|
@@ -47,7 +47,6 @@ class Note(Box):
|
|
|
47
47
|
self.create_time = create_time
|
|
48
48
|
self.creator = creator
|
|
49
49
|
if self.creator is None:
|
|
50
|
-
api_client = ApiClient()
|
|
51
50
|
self.creator = api_client.info()['user_email']
|
|
52
51
|
self.assignee = assignee
|
|
53
52
|
if self.assignee is None:
|
|
@@ -119,7 +118,6 @@ class Message:
|
|
|
119
118
|
self.body = body
|
|
120
119
|
self.creator = creator
|
|
121
120
|
if self.creator is None:
|
|
122
|
-
api_client = ApiClient()
|
|
123
121
|
self.creator = api_client.info()['user_email']
|
|
124
122
|
|
|
125
123
|
def to_json(self):
|
dtlpy/entities/app.py
CHANGED
|
@@ -3,7 +3,8 @@ import traceback
|
|
|
3
3
|
import logging
|
|
4
4
|
import attr
|
|
5
5
|
|
|
6
|
-
from .. import entities,
|
|
6
|
+
from .. import entities, repositories
|
|
7
|
+
from ..services.api_client import ApiClient
|
|
7
8
|
|
|
8
9
|
logger = logging.getLogger(name='dtlpy')
|
|
9
10
|
|
|
@@ -26,7 +27,7 @@ class App(entities.BaseEntity):
|
|
|
26
27
|
|
|
27
28
|
# sdk
|
|
28
29
|
_project = attr.ib(type=entities.Project, repr=False)
|
|
29
|
-
_client_api = attr.ib(type=
|
|
30
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
30
31
|
_repositories = attr.ib(repr=False)
|
|
31
32
|
|
|
32
33
|
@_repositories.default
|
|
@@ -126,7 +127,7 @@ class App(entities.BaseEntity):
|
|
|
126
127
|
return _json
|
|
127
128
|
|
|
128
129
|
@classmethod
|
|
129
|
-
def from_json(cls, _json, client_api:
|
|
130
|
+
def from_json(cls, _json, client_api: ApiClient, project: entities.Project, is_fetched=True):
|
|
130
131
|
app = cls(
|
|
131
132
|
id=_json.get('id', None),
|
|
132
133
|
name=_json.get('name', None),
|
dtlpy/entities/command.py
CHANGED
|
@@ -3,7 +3,8 @@ import traceback
|
|
|
3
3
|
from enum import Enum
|
|
4
4
|
from collections import namedtuple
|
|
5
5
|
|
|
6
|
-
from .. import repositories, entities
|
|
6
|
+
from .. import repositories, entities
|
|
7
|
+
from ..services.api_client import ApiClient
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class CommandsStatus(str, Enum):
|
|
@@ -36,7 +37,7 @@ class Command(entities.BaseEntity):
|
|
|
36
37
|
error = attr.ib()
|
|
37
38
|
|
|
38
39
|
# sdk
|
|
39
|
-
_client_api = attr.ib(type=
|
|
40
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
40
41
|
_repositories = attr.ib(repr=False)
|
|
41
42
|
|
|
42
43
|
################
|
dtlpy/entities/dataset.py
CHANGED
|
@@ -7,6 +7,7 @@ import attr
|
|
|
7
7
|
import os
|
|
8
8
|
|
|
9
9
|
from .. import repositories, entities, services, exceptions
|
|
10
|
+
from ..services.api_client import ApiClient
|
|
10
11
|
from .annotation import ViewAnnotationOptions, AnnotationType, ExportVersion
|
|
11
12
|
|
|
12
13
|
logger = logging.getLogger(name='dtlpy')
|
|
@@ -72,7 +73,7 @@ class Dataset(entities.BaseEntity):
|
|
|
72
73
|
_readonly = attr.ib(repr=False)
|
|
73
74
|
|
|
74
75
|
# api
|
|
75
|
-
_client_api = attr.ib(type=
|
|
76
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
76
77
|
|
|
77
78
|
# entities
|
|
78
79
|
_project = attr.ib(default=None, repr=False)
|
|
@@ -95,7 +96,7 @@ class Dataset(entities.BaseEntity):
|
|
|
95
96
|
@staticmethod
|
|
96
97
|
def _protected_from_json(project: entities.Project,
|
|
97
98
|
_json: dict,
|
|
98
|
-
client_api:
|
|
99
|
+
client_api: ApiClient,
|
|
99
100
|
datasets=None,
|
|
100
101
|
is_fetched=True):
|
|
101
102
|
"""
|
|
@@ -124,7 +125,7 @@ class Dataset(entities.BaseEntity):
|
|
|
124
125
|
def from_json(cls,
|
|
125
126
|
project: entities.Project,
|
|
126
127
|
_json: dict,
|
|
127
|
-
client_api:
|
|
128
|
+
client_api: ApiClient,
|
|
128
129
|
datasets=None,
|
|
129
130
|
is_fetched=True):
|
|
130
131
|
"""
|
dtlpy/entities/dpk.py
CHANGED
|
@@ -5,6 +5,7 @@ import traceback
|
|
|
5
5
|
import enum
|
|
6
6
|
|
|
7
7
|
from .. import entities, services, repositories
|
|
8
|
+
from ..services.api_client import ApiClient
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class SlotType(str, enum.Enum):
|
|
@@ -145,7 +146,7 @@ class Dpk(entities.DlEntity):
|
|
|
145
146
|
url: str = entities.DlProperty(location=['url'], _type=str)
|
|
146
147
|
|
|
147
148
|
# sdk
|
|
148
|
-
client_api:
|
|
149
|
+
client_api: ApiClient
|
|
149
150
|
project: entities.Project
|
|
150
151
|
__repositories = None
|
|
151
152
|
|
|
@@ -265,7 +266,7 @@ class Dpk(entities.DlEntity):
|
|
|
265
266
|
@classmethod
|
|
266
267
|
def from_json(cls,
|
|
267
268
|
_json,
|
|
268
|
-
client_api:
|
|
269
|
+
client_api: ApiClient = None,
|
|
269
270
|
project: entities.Project = None,
|
|
270
271
|
is_fetched=True) -> 'Dpk':
|
|
271
272
|
"""
|
dtlpy/entities/driver.py
CHANGED
|
@@ -2,7 +2,8 @@ import logging
|
|
|
2
2
|
import attr
|
|
3
3
|
from enum import Enum
|
|
4
4
|
from collections import namedtuple
|
|
5
|
-
from .. import
|
|
5
|
+
from .. import entities, repositories
|
|
6
|
+
from ..services.api_client import ApiClient
|
|
6
7
|
|
|
7
8
|
logger = logging.getLogger(name='dtlpy')
|
|
8
9
|
|
|
@@ -13,6 +14,7 @@ class ExternalStorage(str, Enum):
|
|
|
13
14
|
AZUREBLOB = "azureblob"
|
|
14
15
|
KEY_VALUE = "key_value"
|
|
15
16
|
AWS_STS = 'aws-sts'
|
|
17
|
+
AZURE_DATALAKE_GEN2 = 'azureDatalakeGen2'
|
|
16
18
|
|
|
17
19
|
|
|
18
20
|
@attr.s()
|
|
@@ -32,7 +34,7 @@ class Driver(entities.BaseEntity):
|
|
|
32
34
|
id = attr.ib()
|
|
33
35
|
path = attr.ib()
|
|
34
36
|
# api
|
|
35
|
-
_client_api = attr.ib(type=
|
|
37
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
36
38
|
_repositories = attr.ib(repr=False)
|
|
37
39
|
|
|
38
40
|
@_repositories.default
|
dtlpy/entities/execution.py
CHANGED
|
@@ -4,7 +4,8 @@ import traceback
|
|
|
4
4
|
from enum import Enum
|
|
5
5
|
from collections import namedtuple
|
|
6
6
|
|
|
7
|
-
from .. import repositories, entities
|
|
7
|
+
from .. import repositories, entities
|
|
8
|
+
from ..services.api_client import ApiClient
|
|
8
9
|
|
|
9
10
|
logger = logging.getLogger(name='dtlpy')
|
|
10
11
|
|
|
@@ -49,7 +50,7 @@ class Execution(entities.BaseEntity):
|
|
|
49
50
|
package_name = attr.ib()
|
|
50
51
|
|
|
51
52
|
# sdk
|
|
52
|
-
_client_api = attr.ib(type=
|
|
53
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
53
54
|
_service = attr.ib(repr=False)
|
|
54
55
|
_project = attr.ib(repr=False, default=None)
|
|
55
56
|
_repositories = attr.ib(repr=False)
|
dtlpy/entities/feature.py
CHANGED
|
@@ -3,14 +3,16 @@ import traceback
|
|
|
3
3
|
from collections import namedtuple
|
|
4
4
|
from enum import Enum
|
|
5
5
|
|
|
6
|
+
from .. import repositories, entities
|
|
7
|
+
from ..services.api_client import ApiClient
|
|
6
8
|
|
|
7
|
-
from .. import repositories, entities, services
|
|
8
9
|
|
|
9
10
|
class FeatureDataType(str, Enum):
|
|
10
11
|
"""Available types for Feature vectors data type"""
|
|
11
12
|
ANNOTATION_SCORE = 'annotationScore',
|
|
12
13
|
ITEM_SCORE = 'itemScore'
|
|
13
14
|
|
|
15
|
+
|
|
14
16
|
@attr.s
|
|
15
17
|
class Feature(entities.BaseEntity):
|
|
16
18
|
"""
|
|
@@ -32,7 +34,7 @@ class Feature(entities.BaseEntity):
|
|
|
32
34
|
refs = attr.ib()
|
|
33
35
|
|
|
34
36
|
# sdk
|
|
35
|
-
_client_api = attr.ib(type=
|
|
37
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
36
38
|
_repositories = attr.ib(repr=False)
|
|
37
39
|
|
|
38
40
|
################
|
|
@@ -93,8 +95,8 @@ class Feature(entities.BaseEntity):
|
|
|
93
95
|
client_api=client_api,
|
|
94
96
|
org_id=_json.get('org', None),
|
|
95
97
|
creator=_json.get('creator', None),
|
|
96
|
-
refs
|
|
97
|
-
data_type
|
|
98
|
+
refs=_json.get('refs', None),
|
|
99
|
+
data_type=_json.get('dataType', None)
|
|
98
100
|
)
|
|
99
101
|
inst.is_fetched = is_fetched
|
|
100
102
|
return inst
|
dtlpy/entities/feature_set.py
CHANGED
|
@@ -4,7 +4,8 @@ import attr
|
|
|
4
4
|
import traceback
|
|
5
5
|
from collections import namedtuple
|
|
6
6
|
|
|
7
|
-
from .. import repositories, entities
|
|
7
|
+
from .. import repositories, entities
|
|
8
|
+
from ..services.api_client import ApiClient
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
class FeatureEntityType(str, Enum):
|
|
@@ -35,7 +36,7 @@ class FeatureSet(entities.BaseEntity):
|
|
|
35
36
|
data_type = attr.ib()
|
|
36
37
|
|
|
37
38
|
# sdk
|
|
38
|
-
_client_api = attr.ib(type=
|
|
39
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
39
40
|
_repositories = attr.ib(repr=False)
|
|
40
41
|
|
|
41
42
|
################
|
|
@@ -104,7 +105,7 @@ class FeatureSet(entities.BaseEntity):
|
|
|
104
105
|
tags=_json.get('tags', None),
|
|
105
106
|
client_api=client_api,
|
|
106
107
|
org_id=_json.get('org', None),
|
|
107
|
-
data_type
|
|
108
|
+
data_type=_json.get('dataType', None)
|
|
108
109
|
)
|
|
109
110
|
inst.is_fetched = is_fetched
|
|
110
111
|
return inst
|
dtlpy/entities/integration.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import attr
|
|
3
3
|
|
|
4
|
-
from .. import entities,
|
|
4
|
+
from .. import entities, exceptions, repositories
|
|
5
|
+
from ..services.api_client import ApiClient
|
|
5
6
|
|
|
6
7
|
logger = logging.getLogger(name='dtlpy')
|
|
7
8
|
|
|
@@ -18,13 +19,13 @@ class Integration(entities.BaseEntity):
|
|
|
18
19
|
created_at = attr.ib()
|
|
19
20
|
created_by = attr.ib()
|
|
20
21
|
update_at = attr.ib()
|
|
21
|
-
_client_api = attr.ib(type=
|
|
22
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
22
23
|
_project = attr.ib(default=None, repr=False)
|
|
23
24
|
|
|
24
25
|
@classmethod
|
|
25
26
|
def from_json(cls,
|
|
26
27
|
_json: dict,
|
|
27
|
-
client_api:
|
|
28
|
+
client_api: ApiClient,
|
|
28
29
|
is_fetched=True):
|
|
29
30
|
"""
|
|
30
31
|
Build a Integration entity object from a json
|
dtlpy/entities/item.py
CHANGED
|
@@ -7,8 +7,10 @@ import attr
|
|
|
7
7
|
import copy
|
|
8
8
|
import os
|
|
9
9
|
|
|
10
|
-
from .. import repositories, entities,
|
|
10
|
+
from .. import repositories, entities, exceptions
|
|
11
11
|
from .annotation import ViewAnnotationOptions, ExportVersion
|
|
12
|
+
from ..services.api_client import ApiClient
|
|
13
|
+
from ..services.api_client import client as client_api
|
|
12
14
|
|
|
13
15
|
logger = logging.getLogger(name='dtlpy')
|
|
14
16
|
|
|
@@ -53,7 +55,7 @@ class Item(entities.BaseEntity):
|
|
|
53
55
|
annotations_count = attr.ib()
|
|
54
56
|
|
|
55
57
|
# api
|
|
56
|
-
_client_api = attr.ib(type=
|
|
58
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
57
59
|
_platform_dict = attr.ib(repr=False)
|
|
58
60
|
|
|
59
61
|
# entities
|
|
@@ -160,7 +162,7 @@ class Item(entities.BaseEntity):
|
|
|
160
162
|
# create a new item, and update the current one with the same state
|
|
161
163
|
# this way we can have _client_api, and all the repositories and entities which are not picklable
|
|
162
164
|
self.__dict__.update(entities.Item.from_json(_json=state,
|
|
163
|
-
client_api=
|
|
165
|
+
client_api=client_api).__dict__)
|
|
164
166
|
|
|
165
167
|
############
|
|
166
168
|
# entities #
|
dtlpy/entities/model.py
CHANGED
|
@@ -5,7 +5,8 @@ import logging
|
|
|
5
5
|
|
|
6
6
|
import attr
|
|
7
7
|
|
|
8
|
-
from .. import repositories, entities
|
|
8
|
+
from .. import repositories, entities
|
|
9
|
+
from ..services.api_client import ApiClient
|
|
9
10
|
|
|
10
11
|
logger = logging.getLogger(name='dtlpy')
|
|
11
12
|
|
|
@@ -76,7 +77,7 @@ class Model(entities.BaseEntity):
|
|
|
76
77
|
_project = attr.ib(repr=False)
|
|
77
78
|
_package = attr.ib(repr=False)
|
|
78
79
|
_dataset = attr.ib(repr=False)
|
|
79
|
-
_client_api = attr.ib(type=
|
|
80
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
80
81
|
_repositories = attr.ib(repr=False)
|
|
81
82
|
_ontology = attr.ib(repr=False, default=None)
|
|
82
83
|
|
dtlpy/entities/node.py
CHANGED
|
@@ -186,6 +186,7 @@ class PipelineNode:
|
|
|
186
186
|
metadata: dict = None,
|
|
187
187
|
config: dict = None,
|
|
188
188
|
position: tuple = (1, 1),
|
|
189
|
+
app_id: str = None,
|
|
189
190
|
):
|
|
190
191
|
"""
|
|
191
192
|
:param str name: node name
|
|
@@ -198,6 +199,7 @@ class PipelineNode:
|
|
|
198
199
|
:param str project_id: project id
|
|
199
200
|
:param dict config: for the code node dict in format { package: {code : the_code}}
|
|
200
201
|
:param tuple position: tuple of the node place
|
|
202
|
+
:param str app_id: app id
|
|
201
203
|
"""
|
|
202
204
|
self.name = name
|
|
203
205
|
self.node_id = node_id
|
|
@@ -209,6 +211,7 @@ class PipelineNode:
|
|
|
209
211
|
self.project_id = project_id
|
|
210
212
|
self.config = config
|
|
211
213
|
self.position = position
|
|
214
|
+
self.app_id = app_id
|
|
212
215
|
self._pipeline = None
|
|
213
216
|
|
|
214
217
|
@property
|
|
@@ -259,7 +262,8 @@ class PipelineNode:
|
|
|
259
262
|
namespace=namespace,
|
|
260
263
|
project_id=_json.get('projectId', None),
|
|
261
264
|
config=_json.get('config', None),
|
|
262
|
-
position=position
|
|
265
|
+
position=position,
|
|
266
|
+
app_id=_json.get('appId', None)
|
|
263
267
|
)
|
|
264
268
|
|
|
265
269
|
def to_json(self):
|
|
@@ -275,6 +279,8 @@ class PipelineNode:
|
|
|
275
279
|
}
|
|
276
280
|
if self.config is not None:
|
|
277
281
|
_json['config'] = self.config
|
|
282
|
+
if self.app_id is not None:
|
|
283
|
+
_json['appId'] = self.app_id
|
|
278
284
|
return _json
|
|
279
285
|
|
|
280
286
|
def is_root(self):
|
dtlpy/entities/ontology.py
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import traceback
|
|
3
1
|
from collections import namedtuple
|
|
2
|
+
import traceback
|
|
4
3
|
import logging
|
|
5
4
|
import random
|
|
6
5
|
import uuid
|
|
7
6
|
import attr
|
|
7
|
+
import os
|
|
8
8
|
|
|
9
|
-
from .. import entities, PlatformException, repositories,
|
|
10
|
-
|
|
9
|
+
from .. import entities, PlatformException, repositories, exceptions
|
|
10
|
+
from ..services.api_client import ApiClient
|
|
11
11
|
from .label import Label
|
|
12
12
|
|
|
13
13
|
logger = logging.getLogger(name='dtlpy')
|
|
@@ -43,7 +43,7 @@ class Ontology(entities.BaseEntity):
|
|
|
43
43
|
Ontology object
|
|
44
44
|
"""
|
|
45
45
|
# api
|
|
46
|
-
_client_api = attr.ib(type=
|
|
46
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
47
47
|
|
|
48
48
|
# params
|
|
49
49
|
id = attr.ib()
|
dtlpy/entities/organization.py
CHANGED
|
@@ -4,7 +4,8 @@ import traceback
|
|
|
4
4
|
import logging
|
|
5
5
|
import attr
|
|
6
6
|
|
|
7
|
-
from .. import repositories,
|
|
7
|
+
from .. import repositories, entities
|
|
8
|
+
from ..services.api_client import ApiClient
|
|
8
9
|
|
|
9
10
|
logger = logging.getLogger(name='dtlpy')
|
|
10
11
|
|
|
@@ -51,7 +52,7 @@ class Organization(entities.BaseEntity):
|
|
|
51
52
|
created_by = attr.ib(repr=False)
|
|
52
53
|
|
|
53
54
|
# api
|
|
54
|
-
_client_api = attr.ib(type=
|
|
55
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
55
56
|
|
|
56
57
|
# repositories
|
|
57
58
|
_repositories = attr.ib(repr=False)
|
dtlpy/entities/package.py
CHANGED
|
@@ -10,7 +10,8 @@ import os
|
|
|
10
10
|
|
|
11
11
|
from .package_module import PackageModule
|
|
12
12
|
from .package_slot import PackageSlot
|
|
13
|
-
from .. import repositories, entities, exceptions
|
|
13
|
+
from .. import repositories, entities, exceptions
|
|
14
|
+
from ..services.api_client import ApiClient
|
|
14
15
|
|
|
15
16
|
logger = logging.getLogger(name='dtlpy')
|
|
16
17
|
|
|
@@ -79,7 +80,7 @@ class Package(entities.DlEntity):
|
|
|
79
80
|
_kls='PackageRequirement')
|
|
80
81
|
|
|
81
82
|
# sdk
|
|
82
|
-
_client_api:
|
|
83
|
+
_client_api: ApiClient
|
|
83
84
|
_revisions = None
|
|
84
85
|
__repositories = None
|
|
85
86
|
_project = None
|
dtlpy/entities/paged_entities.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import math
|
|
3
|
+
import tqdm
|
|
3
4
|
import copy
|
|
4
5
|
import sys
|
|
5
6
|
|
|
6
7
|
import attr
|
|
7
|
-
from .. import
|
|
8
|
-
import
|
|
8
|
+
from .. import miscellaneous
|
|
9
|
+
from ..services.api_client import ApiClient
|
|
9
10
|
|
|
10
11
|
logger = logging.getLogger(name='dtlpy')
|
|
11
12
|
|
|
@@ -16,7 +17,7 @@ class PagedEntities:
|
|
|
16
17
|
Pages object
|
|
17
18
|
"""
|
|
18
19
|
# api
|
|
19
|
-
_client_api = attr.ib(type=
|
|
20
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
20
21
|
|
|
21
22
|
# params
|
|
22
23
|
page_offset = attr.ib()
|
dtlpy/entities/pipeline.py
CHANGED
|
@@ -5,7 +5,8 @@ from enum import Enum
|
|
|
5
5
|
from typing import List
|
|
6
6
|
import attr
|
|
7
7
|
from .node import PipelineNode, PipelineConnection, TaskNode, CodeNode, FunctionNode, DatasetNode
|
|
8
|
-
from .. import repositories, entities
|
|
8
|
+
from .. import repositories, entities
|
|
9
|
+
from ..services.api_client import ApiClient
|
|
9
10
|
|
|
10
11
|
logger = logging.getLogger(name='dtlpy')
|
|
11
12
|
|
|
@@ -184,7 +185,7 @@ class Pipeline(entities.BaseEntity):
|
|
|
184
185
|
|
|
185
186
|
# sdk
|
|
186
187
|
_project = attr.ib(repr=False)
|
|
187
|
-
_client_api = attr.ib(type=
|
|
188
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
188
189
|
_original_settings = attr.ib(repr=False, type=PipelineSettings)
|
|
189
190
|
_repositories = attr.ib(repr=False)
|
|
190
191
|
|
|
@@ -452,7 +453,7 @@ class Pipeline(entities.BaseEntity):
|
|
|
452
453
|
|
|
453
454
|
command = pipeline.execute_batch(
|
|
454
455
|
execution_inputs=dl.FunctionIO(type=dl.PackageInputType.STRING, value='test', name='string'),
|
|
455
|
-
filters=dl.Filters(field='dir', values='/test'))
|
|
456
|
+
filters=dl.Filters(field='dir', values='/test', context={'datasets': [dataset.id]))
|
|
456
457
|
"""
|
|
457
458
|
command = self.pipeline_executions.create_batch(pipeline_id=self.id,
|
|
458
459
|
execution_inputs=execution_inputs,
|