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
|
@@ -3,7 +3,8 @@ import logging
|
|
|
3
3
|
import traceback
|
|
4
4
|
import attr
|
|
5
5
|
|
|
6
|
-
from .. import repositories, entities
|
|
6
|
+
from .. import repositories, entities
|
|
7
|
+
from ..services.api_client import ApiClient
|
|
7
8
|
|
|
8
9
|
logger = logging.getLogger(name='dtlpy')
|
|
9
10
|
|
|
@@ -63,10 +64,11 @@ class PipelineExecution(entities.BaseEntity):
|
|
|
63
64
|
updated_at = attr.ib(repr=False)
|
|
64
65
|
pipeline_id = attr.ib()
|
|
65
66
|
max_attempts = attr.ib()
|
|
67
|
+
creator = attr.ib()
|
|
66
68
|
|
|
67
69
|
# sdk
|
|
68
70
|
_pipeline = attr.ib(repr=False)
|
|
69
|
-
_client_api = attr.ib(type=
|
|
71
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
70
72
|
_repositories = attr.ib(repr=False)
|
|
71
73
|
|
|
72
74
|
@staticmethod
|
|
@@ -126,6 +128,7 @@ class PipelineExecution(entities.BaseEntity):
|
|
|
126
128
|
pipeline_id=_json.get('pipelineId', None),
|
|
127
129
|
status=_json.get('status', None),
|
|
128
130
|
max_attempts=_json.get('maxAttempts', None),
|
|
131
|
+
creator=_json.get('creator', None),
|
|
129
132
|
nodes=nodes,
|
|
130
133
|
executions=executions,
|
|
131
134
|
pipeline=pipeline,
|
|
@@ -150,7 +153,7 @@ class PipelineExecution(entities.BaseEntity):
|
|
|
150
153
|
attr.fields(PipelineExecution).updated_at,
|
|
151
154
|
attr.fields(PipelineExecution).pipeline_id,
|
|
152
155
|
attr.fields(PipelineExecution).executions,
|
|
153
|
-
attr.fields(PipelineExecution).max_attempts
|
|
156
|
+
attr.fields(PipelineExecution).max_attempts
|
|
154
157
|
))
|
|
155
158
|
executions = dict()
|
|
156
159
|
for node_id, executions_list in self.executions.items():
|
dtlpy/entities/project.py
CHANGED
|
@@ -4,7 +4,8 @@ import traceback
|
|
|
4
4
|
import logging
|
|
5
5
|
import attr
|
|
6
6
|
|
|
7
|
-
from .. import repositories, miscellaneous,
|
|
7
|
+
from .. import repositories, miscellaneous, entities
|
|
8
|
+
from ..services.api_client import ApiClient
|
|
8
9
|
|
|
9
10
|
logger = logging.getLogger(name='dtlpy')
|
|
10
11
|
|
|
@@ -37,7 +38,7 @@ class Project(entities.BaseEntity):
|
|
|
37
38
|
feature_constraints = attr.ib()
|
|
38
39
|
|
|
39
40
|
# api
|
|
40
|
-
_client_api = attr.ib(type=
|
|
41
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
41
42
|
|
|
42
43
|
# repositories
|
|
43
44
|
_repositories = attr.ib(repr=False)
|
dtlpy/entities/recipe.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import traceback
|
|
3
|
-
import uuid
|
|
4
1
|
from collections import namedtuple
|
|
2
|
+
import traceback
|
|
5
3
|
import logging
|
|
4
|
+
import uuid
|
|
6
5
|
import attr
|
|
6
|
+
import os
|
|
7
7
|
|
|
8
|
-
from .. import repositories, entities,
|
|
8
|
+
from .. import repositories, entities, exceptions
|
|
9
|
+
from ..services.api_client import ApiClient
|
|
9
10
|
|
|
10
11
|
logger = logging.getLogger(name='dtlpy')
|
|
11
12
|
|
|
@@ -31,7 +32,7 @@ class Recipe(entities.BaseEntity):
|
|
|
31
32
|
ui_settings = attr.ib()
|
|
32
33
|
|
|
33
34
|
# platform
|
|
34
|
-
_client_api = attr.ib(type=
|
|
35
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
35
36
|
# entities
|
|
36
37
|
_dataset = attr.ib(repr=False, default=None)
|
|
37
38
|
_project = attr.ib(repr=False, default=None)
|
|
@@ -2,7 +2,8 @@ import attr
|
|
|
2
2
|
import logging
|
|
3
3
|
import traceback
|
|
4
4
|
|
|
5
|
-
from .. import repositories, entities
|
|
5
|
+
from .. import repositories, entities
|
|
6
|
+
from ..services.api_client import ApiClient
|
|
6
7
|
|
|
7
8
|
logger = logging.getLogger(name='dtlpy')
|
|
8
9
|
|
|
@@ -30,7 +31,7 @@ class ResourceExecution(entities.BaseEntity):
|
|
|
30
31
|
project_id = attr.ib()
|
|
31
32
|
|
|
32
33
|
# sdk
|
|
33
|
-
_client_api = attr.ib(type=
|
|
34
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
34
35
|
_project = attr.ib()
|
|
35
36
|
resource = attr.ib()
|
|
36
37
|
|
|
@@ -135,4 +136,3 @@ class ResourceExecution(entities.BaseEntity):
|
|
|
135
136
|
fetch=None)
|
|
136
137
|
assert isinstance(self._project, entities.Project)
|
|
137
138
|
return self._project
|
|
138
|
-
|
dtlpy/entities/service.py
CHANGED
|
@@ -5,7 +5,8 @@ import logging
|
|
|
5
5
|
from typing import List
|
|
6
6
|
from urllib.parse import urlsplit
|
|
7
7
|
import attr
|
|
8
|
-
from .. import
|
|
8
|
+
from .. import repositories, entities
|
|
9
|
+
from ..services.api_client import ApiClient
|
|
9
10
|
|
|
10
11
|
logger = logging.getLogger(name='dtlpy')
|
|
11
12
|
|
|
@@ -26,6 +27,24 @@ class ServiceType(str, Enum):
|
|
|
26
27
|
REGULAR = 'regular'
|
|
27
28
|
|
|
28
29
|
|
|
30
|
+
class ServiceModeType(str, Enum):
|
|
31
|
+
""" The type of the service mode.
|
|
32
|
+
|
|
33
|
+
.. list-table::
|
|
34
|
+
:widths: 15 150
|
|
35
|
+
:header-rows: 1
|
|
36
|
+
|
|
37
|
+
* - State
|
|
38
|
+
- Description
|
|
39
|
+
* - REGULAR
|
|
40
|
+
- Service regular mode type
|
|
41
|
+
* - DEBUG
|
|
42
|
+
- Service debug mode type
|
|
43
|
+
"""
|
|
44
|
+
REGULAR = 'regular'
|
|
45
|
+
DEBUG = 'debug'
|
|
46
|
+
|
|
47
|
+
|
|
29
48
|
class OnResetAction(str, Enum):
|
|
30
49
|
""" The Execution action when the service reset (RERUN, FAILED).
|
|
31
50
|
|
|
@@ -200,10 +219,11 @@ class Service(entities.BaseEntity):
|
|
|
200
219
|
project_id = attr.ib()
|
|
201
220
|
is_global = attr.ib()
|
|
202
221
|
max_attempts = attr.ib()
|
|
222
|
+
mode = attr.ib(repr=False)
|
|
203
223
|
|
|
204
224
|
# SDK
|
|
205
225
|
_package = attr.ib(repr=False)
|
|
206
|
-
_client_api = attr.ib(type=
|
|
226
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
207
227
|
_revisions = attr.ib(default=None, repr=False)
|
|
208
228
|
# repositories
|
|
209
229
|
_project = attr.ib(default=None, repr=False)
|
|
@@ -218,7 +238,7 @@ class Service(entities.BaseEntity):
|
|
|
218
238
|
return self.updated_at
|
|
219
239
|
|
|
220
240
|
@staticmethod
|
|
221
|
-
def _protected_from_json(_json: dict, client_api:
|
|
241
|
+
def _protected_from_json(_json: dict, client_api: ApiClient, package=None, project=None, is_fetched=True):
|
|
222
242
|
"""
|
|
223
243
|
Same as from_json but with try-except to catch if error
|
|
224
244
|
|
|
@@ -242,7 +262,7 @@ class Service(entities.BaseEntity):
|
|
|
242
262
|
return status, service
|
|
243
263
|
|
|
244
264
|
@classmethod
|
|
245
|
-
def from_json(cls, _json: dict, client_api:
|
|
265
|
+
def from_json(cls, _json: dict, client_api: ApiClient=None, package=None, project=None, is_fetched=True):
|
|
246
266
|
"""
|
|
247
267
|
Build a service entity object from a json
|
|
248
268
|
|
|
@@ -300,7 +320,8 @@ class Service(entities.BaseEntity):
|
|
|
300
320
|
package=package,
|
|
301
321
|
project=project,
|
|
302
322
|
secrets=_json.get("secrets", None),
|
|
303
|
-
type=_json.get("type", None)
|
|
323
|
+
type=_json.get("type", None),
|
|
324
|
+
mode=_json.get('mode', dict()),
|
|
304
325
|
)
|
|
305
326
|
inst.is_fetched = is_fetched
|
|
306
327
|
return inst
|
|
@@ -419,6 +440,7 @@ class Service(entities.BaseEntity):
|
|
|
419
440
|
attr.fields(Service).updated_at,
|
|
420
441
|
attr.fields(Service).secrets,
|
|
421
442
|
attr.fields(Service)._type,
|
|
443
|
+
attr.fields(Service).mode,
|
|
422
444
|
)
|
|
423
445
|
)
|
|
424
446
|
|
|
@@ -456,6 +478,9 @@ class Service(entities.BaseEntity):
|
|
|
456
478
|
if self._type is not None:
|
|
457
479
|
_json['type'] = self._type
|
|
458
480
|
|
|
481
|
+
if self.mode:
|
|
482
|
+
_json['mode'] = self.mode
|
|
483
|
+
|
|
459
484
|
return _json
|
|
460
485
|
|
|
461
486
|
def update(self, force=False):
|
|
@@ -633,7 +658,7 @@ class Service(entities.BaseEntity):
|
|
|
633
658
|
|
|
634
659
|
command = service.execute_batch(
|
|
635
660
|
execution_inputs=dl.FunctionIO(type=dl.PackageInputType.STRING, value='test', name='string'),
|
|
636
|
-
filters=dl.Filters(field='dir', values='/test'),
|
|
661
|
+
filters=dl.Filters(field='dir', values='/test', context={"datasets": [dataset.id]),
|
|
637
662
|
function_name='run')
|
|
638
663
|
"""
|
|
639
664
|
execution = self.executions.create_batch(service_id=self.id,
|
dtlpy/entities/trigger.py
CHANGED
|
@@ -4,7 +4,8 @@ import logging
|
|
|
4
4
|
from enum import Enum
|
|
5
5
|
from collections import namedtuple
|
|
6
6
|
|
|
7
|
-
from .. import entities,
|
|
7
|
+
from .. import entities, exceptions, repositories
|
|
8
|
+
from ..services.api_client import ApiClient
|
|
8
9
|
|
|
9
10
|
logger = logging.getLogger(name='dtlpy')
|
|
10
11
|
|
|
@@ -79,7 +80,7 @@ class BaseTrigger(entities.BaseEntity):
|
|
|
79
80
|
##################
|
|
80
81
|
_service = attr.ib(repr=False)
|
|
81
82
|
_project = attr.ib(repr=False)
|
|
82
|
-
_client_api = attr.ib(type=
|
|
83
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
83
84
|
_op_type = attr.ib(default='service')
|
|
84
85
|
_repositories = attr.ib(repr=False)
|
|
85
86
|
|
dtlpy/entities/webhook.py
CHANGED
|
@@ -2,7 +2,8 @@ import logging
|
|
|
2
2
|
import attr
|
|
3
3
|
from enum import Enum
|
|
4
4
|
|
|
5
|
-
from .. import
|
|
5
|
+
from .. import repositories, entities
|
|
6
|
+
from ..services.api_client import ApiClient
|
|
6
7
|
|
|
7
8
|
logger = logging.getLogger(name='dtlpy')
|
|
8
9
|
|
|
@@ -33,7 +34,7 @@ class Webhook(entities.BaseEntity):
|
|
|
33
34
|
hook_url = attr.ib()
|
|
34
35
|
|
|
35
36
|
# SDK
|
|
36
|
-
_client_api = attr.ib(type=
|
|
37
|
+
_client_api = attr.ib(type=ApiClient, repr=False)
|
|
37
38
|
_project = attr.ib()
|
|
38
39
|
|
|
39
40
|
# repos
|
|
@@ -48,7 +49,7 @@ class Webhook(entities.BaseEntity):
|
|
|
48
49
|
return self.updated_at
|
|
49
50
|
|
|
50
51
|
@classmethod
|
|
51
|
-
def from_json(cls, _json: dict, client_api:
|
|
52
|
+
def from_json(cls, _json: dict, client_api: ApiClient, project=None):
|
|
52
53
|
"""
|
|
53
54
|
:param _json: platform json
|
|
54
55
|
:param client_api: ApiClient entity
|
dtlpy/ml/base_model_adapter.py
CHANGED
|
@@ -315,21 +315,23 @@ class BaseModelAdapter(utilities.BaseServiceRunner):
|
|
|
315
315
|
else:
|
|
316
316
|
raise ValueError('Unknown inputType: {} (from model_entity.input_type'.format(input_type))
|
|
317
317
|
batch_collections = self.predict(batch, **kwargs)
|
|
318
|
-
for collection in batch_collections:
|
|
319
|
-
# convert annotation collection to a list aof annotations jsons
|
|
320
|
-
if isinstance(collection, entities.AnnotationCollection):
|
|
321
|
-
annotations.append(collection.to_json()['annotations'])
|
|
322
|
-
else:
|
|
323
|
-
annotations.append(collection)
|
|
324
318
|
if upload_annotations is True:
|
|
325
319
|
self.logger.debug(
|
|
326
320
|
"Uploading items' annotation for model {!r}.".format(self.model_entity.name))
|
|
327
321
|
try:
|
|
328
|
-
|
|
329
|
-
|
|
322
|
+
batch_collections = list(pool.map(partial(self._upload_model_annotations),
|
|
323
|
+
batch_items, batch_collections))
|
|
330
324
|
except Exception as err:
|
|
331
325
|
self.logger.exception("Failed to upload annotations items.")
|
|
332
326
|
|
|
327
|
+
for collection in batch_collections:
|
|
328
|
+
# function needs to return `List[List[dl.Annotation]]`
|
|
329
|
+
# convert annotation collection to a list of dl.Annotation for each batch
|
|
330
|
+
if isinstance(collection, entities.AnnotationCollection):
|
|
331
|
+
annotations.extend([annotation for annotation in collection.annotations])
|
|
332
|
+
else:
|
|
333
|
+
logger.warning(f'RETURN TYPE MAY BE INVALID: {type(collection)}')
|
|
334
|
+
annotations.extend(collection)
|
|
333
335
|
pool.shutdown()
|
|
334
336
|
return items, annotations
|
|
335
337
|
|
dtlpy/new_instance.py
CHANGED
|
@@ -7,7 +7,8 @@ class Dtlpy:
|
|
|
7
7
|
AnnotationCollection, Annotation, Item, Codebase, Filters, Execution, Recipe, Ontology, Label, Similarity, \
|
|
8
8
|
ItemLink, UrlLink, PackageModule, PackageFunction, FunctionIO, Modality, Workload, WorkloadUnit
|
|
9
9
|
from .utilities import Converter, BaseServiceRunner, Progress
|
|
10
|
-
from .services import ApiClient
|
|
10
|
+
from .services.api_client import ApiClient
|
|
11
|
+
from .services import check_sdk
|
|
11
12
|
|
|
12
13
|
def __init__(self, cookie_filepath=None):
|
|
13
14
|
self.client_api = self.ApiClient(cookie_filepath=cookie_filepath)
|
dtlpy/repositories/analytics.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import pandas as pd
|
|
3
|
-
|
|
4
|
-
from
|
|
3
|
+
from dtlpy import entities, exceptions
|
|
4
|
+
from ..services.api_client import ApiClient
|
|
5
5
|
|
|
6
6
|
logger = logging.getLogger(name='dtlpy')
|
|
7
7
|
|
|
@@ -11,7 +11,7 @@ class Analytics:
|
|
|
11
11
|
Time series Repository
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
|
-
def __init__(self, client_api:
|
|
14
|
+
def __init__(self, client_api: ApiClient, project: entities.Project = None):
|
|
15
15
|
self._client_api = client_api
|
|
16
16
|
self._project = project
|
|
17
17
|
|
|
@@ -5,7 +5,8 @@ import json
|
|
|
5
5
|
import jwt
|
|
6
6
|
import os
|
|
7
7
|
|
|
8
|
-
from .. import entities, exceptions, miscellaneous,
|
|
8
|
+
from .. import entities, exceptions, miscellaneous, _api_reference
|
|
9
|
+
from ..services.api_client import ApiClient
|
|
9
10
|
|
|
10
11
|
logger = logging.getLogger(name='dtlpy')
|
|
11
12
|
|
|
@@ -21,7 +22,7 @@ class Annotations:
|
|
|
21
22
|
`Show Video with Annotations <https://dataloop.ai/docs/sdk-show-videos>`_.
|
|
22
23
|
"""
|
|
23
24
|
|
|
24
|
-
def __init__(self, client_api:
|
|
25
|
+
def __init__(self, client_api: ApiClient, item=None, dataset=None, dataset_id=None):
|
|
25
26
|
self._client_api = client_api
|
|
26
27
|
self._item = item
|
|
27
28
|
self._dataset = dataset
|
dtlpy/repositories/apps.py
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
|
-
from .. import entities,
|
|
3
|
+
from .. import entities, exceptions, miscellaneous
|
|
4
|
+
from ..services.api_client import ApiClient
|
|
4
5
|
|
|
5
6
|
logger = logging.getLogger(name='dtlpy')
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
class Apps:
|
|
9
10
|
|
|
10
|
-
def __init__(self, client_api:
|
|
11
|
+
def __init__(self, client_api: ApiClient, project: entities.Project = None):
|
|
11
12
|
self._client_api = client_api
|
|
12
13
|
self._project = project
|
|
13
14
|
|
dtlpy/repositories/artifacts.py
CHANGED
|
@@ -4,7 +4,8 @@ import logging
|
|
|
4
4
|
import shutil
|
|
5
5
|
import os
|
|
6
6
|
|
|
7
|
-
from .. import entities, miscellaneous, PlatformException, exceptions,
|
|
7
|
+
from .. import entities, miscellaneous, PlatformException, exceptions, repositories
|
|
8
|
+
from ..services.api_client import ApiClient
|
|
8
9
|
|
|
9
10
|
logger = logging.getLogger(name='dtlpy')
|
|
10
11
|
|
|
@@ -15,7 +16,7 @@ class Artifacts:
|
|
|
15
16
|
"""
|
|
16
17
|
|
|
17
18
|
def __init__(self,
|
|
18
|
-
client_api:
|
|
19
|
+
client_api: ApiClient,
|
|
19
20
|
project: entities.Project = None,
|
|
20
21
|
dataset: entities.Dataset = None,
|
|
21
22
|
project_id: str = None,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
|
-
from .. import exceptions, miscellaneous, entities, repositories,
|
|
3
|
+
from .. import exceptions, miscellaneous, entities, repositories, _api_reference
|
|
4
|
+
from ..services.api_client import ApiClient
|
|
4
5
|
|
|
5
6
|
logger = logging.getLogger(name='dtlpy')
|
|
6
7
|
|
|
@@ -13,7 +14,7 @@ class Assignments:
|
|
|
13
14
|
"""
|
|
14
15
|
|
|
15
16
|
def __init__(self,
|
|
16
|
-
client_api:
|
|
17
|
+
client_api: ApiClient,
|
|
17
18
|
project: entities.Project = None,
|
|
18
19
|
task: entities.Task = None,
|
|
19
20
|
dataset: entities.Dataset = None,
|
dtlpy/repositories/bots.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from .. import entities, miscellaneous, exceptions
|
|
2
|
+
from .. import entities, miscellaneous, exceptions
|
|
3
|
+
from ..services.api_client import ApiClient
|
|
3
4
|
|
|
4
5
|
logger = logging.getLogger(name='dtlpy')
|
|
5
6
|
|
|
@@ -11,7 +12,7 @@ class Bots:
|
|
|
11
12
|
The Bots class allows the user to manage bots and their properties. See our documentation for more information on `bots <https://dataloop.ai/docs/faas-bot>`_.
|
|
12
13
|
"""
|
|
13
14
|
|
|
14
|
-
def __init__(self, client_api:
|
|
15
|
+
def __init__(self, client_api: ApiClient, project: entities.Project):
|
|
15
16
|
self._client_api = client_api
|
|
16
17
|
self._project = project
|
|
17
18
|
|
dtlpy/repositories/codebases.py
CHANGED
|
@@ -5,7 +5,9 @@ import io
|
|
|
5
5
|
import random
|
|
6
6
|
from typing import List
|
|
7
7
|
|
|
8
|
-
from .. import entities, PlatformException, exceptions, repositories, miscellaneous
|
|
8
|
+
from .. import entities, PlatformException, exceptions, repositories, miscellaneous
|
|
9
|
+
from ..services.api_client import ApiClient
|
|
10
|
+
from ..services.api_client import client as client_api
|
|
9
11
|
|
|
10
12
|
logger = logging.getLogger(name='dtlpy')
|
|
11
13
|
|
|
@@ -18,7 +20,7 @@ class Codebases:
|
|
|
18
20
|
"""
|
|
19
21
|
|
|
20
22
|
def __init__(self,
|
|
21
|
-
client_api:
|
|
23
|
+
client_api: ApiClient,
|
|
22
24
|
project: entities.Project = None,
|
|
23
25
|
dataset: entities.Dataset = None,
|
|
24
26
|
project_id: str = None):
|
|
@@ -35,7 +37,7 @@ class Codebases:
|
|
|
35
37
|
if self._dataset is not None or self._project is not None:
|
|
36
38
|
self._items_repository = self.dataset.items
|
|
37
39
|
else:
|
|
38
|
-
self._items_repository = repositories.Items(client_api=
|
|
40
|
+
self._items_repository = repositories.Items(client_api=client_api)
|
|
39
41
|
assert isinstance(self._items_repository, repositories.Items)
|
|
40
42
|
return self._items_repository
|
|
41
43
|
|
dtlpy/repositories/commands.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import warnings
|
|
1
3
|
import logging
|
|
2
|
-
import sys
|
|
3
4
|
import time
|
|
4
|
-
import numpy as np
|
|
5
5
|
import tqdm
|
|
6
|
-
import
|
|
6
|
+
import sys
|
|
7
7
|
|
|
8
|
-
from .. import exceptions, entities,
|
|
8
|
+
from .. import exceptions, entities, miscellaneous
|
|
9
|
+
from ..services.api_client import ApiClient
|
|
9
10
|
|
|
10
11
|
logger = logging.getLogger(name='dtlpy')
|
|
11
12
|
|
|
@@ -17,7 +18,7 @@ class Commands:
|
|
|
17
18
|
Service Commands repository
|
|
18
19
|
"""
|
|
19
20
|
|
|
20
|
-
def __init__(self, client_api:
|
|
21
|
+
def __init__(self, client_api: ApiClient):
|
|
21
22
|
self._client_api = client_api
|
|
22
23
|
|
|
23
24
|
############
|
dtlpy/repositories/datasets.py
CHANGED
|
@@ -8,7 +8,9 @@ import copy
|
|
|
8
8
|
import tqdm
|
|
9
9
|
import logging
|
|
10
10
|
from urllib.parse import urlencode
|
|
11
|
+
|
|
11
12
|
from .. import entities, repositories, miscellaneous, exceptions, services, PlatformException, _api_reference
|
|
13
|
+
from ..services.api_client import ApiClient
|
|
12
14
|
|
|
13
15
|
logger = logging.getLogger(name='dtlpy')
|
|
14
16
|
|
|
@@ -20,7 +22,7 @@ class Datasets:
|
|
|
20
22
|
The Datasets class allows the user to manage datasets. Read more about datasets in our `documentation <https://dataloop.ai/docs/dataset>`_ and `SDK documentation <https://dataloop.ai/docs/sdk-create-dataset>`_.
|
|
21
23
|
"""
|
|
22
24
|
|
|
23
|
-
def __init__(self, client_api:
|
|
25
|
+
def __init__(self, client_api: ApiClient, project: entities.Project = None):
|
|
24
26
|
self._client_api = client_api
|
|
25
27
|
self._project = project
|
|
26
28
|
|
dtlpy/repositories/dpks.py
CHANGED
|
@@ -4,12 +4,13 @@ import os
|
|
|
4
4
|
from typing import List, Optional
|
|
5
5
|
|
|
6
6
|
from .. import exceptions, entities, services, miscellaneous, assets
|
|
7
|
+
from ..services.api_client import ApiClient
|
|
7
8
|
|
|
8
9
|
logger = logging.getLogger(name='dtlpy')
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class Dpks:
|
|
12
|
-
def __init__(self, client_api:
|
|
13
|
+
def __init__(self, client_api: ApiClient, project: entities.Project = None):
|
|
13
14
|
self._client_api = client_api
|
|
14
15
|
self._project = project
|
|
15
16
|
self._revisions = None
|
dtlpy/repositories/drivers.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
|
-
from .. import entities, miscellaneous, exceptions,
|
|
3
|
+
from .. import entities, miscellaneous, exceptions, _api_reference
|
|
4
|
+
from ..services.api_client import ApiClient
|
|
4
5
|
|
|
5
6
|
logger = logging.getLogger(name='dtlpy')
|
|
6
7
|
|
|
@@ -12,7 +13,7 @@ class Drivers:
|
|
|
12
13
|
The Drivers class allows users to manage drivers that are used to connect with external storage. Read more about external storage in our `documentation <https://dataloop.ai/docs/storage>`_ and `SDK documentation <https://dataloop.ai/docs/sdk-sync-storage>`_.
|
|
13
14
|
"""
|
|
14
15
|
|
|
15
|
-
def __init__(self, client_api:
|
|
16
|
+
def __init__(self, client_api: ApiClient, project: entities.Project = None):
|
|
16
17
|
self._client_api = client_api
|
|
17
18
|
self._project = project
|
|
18
19
|
|
|
@@ -87,7 +88,7 @@ class Drivers:
|
|
|
87
88
|
driver_class = entities.S3Driver
|
|
88
89
|
elif driver_type == entities.ExternalStorage.GCS:
|
|
89
90
|
driver_class = entities.GcsDriver
|
|
90
|
-
elif driver_type
|
|
91
|
+
elif driver_type in [entities.ExternalStorage.AZUREBLOB, entities.ExternalStorage.AZURE_DATALAKE_GEN2]:
|
|
91
92
|
driver_class = entities.AzureBlobDriver
|
|
92
93
|
else:
|
|
93
94
|
driver_class = entities.Driver
|
dtlpy/repositories/executions.py
CHANGED
|
@@ -3,7 +3,8 @@ import logging
|
|
|
3
3
|
import time
|
|
4
4
|
import numpy as np
|
|
5
5
|
|
|
6
|
-
from .. import exceptions, entities, repositories, miscellaneous,
|
|
6
|
+
from .. import exceptions, entities, repositories, miscellaneous, _api_reference
|
|
7
|
+
from ..services.api_client import ApiClient
|
|
7
8
|
|
|
8
9
|
logger = logging.getLogger(name='dtlpy')
|
|
9
10
|
|
|
@@ -16,7 +17,7 @@ class Executions:
|
|
|
16
17
|
"""
|
|
17
18
|
|
|
18
19
|
def __init__(self,
|
|
19
|
-
client_api:
|
|
20
|
+
client_api: ApiClient,
|
|
20
21
|
service: entities.Service = None,
|
|
21
22
|
project: entities.Project = None):
|
|
22
23
|
self._client_api = client_api
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
from .. import exceptions, entities,
|
|
2
|
+
from .. import exceptions, entities, miscellaneous, _api_reference
|
|
3
|
+
from ..services.api_client import ApiClient
|
|
3
4
|
|
|
4
5
|
logger = logging.getLogger(name='dtlpy')
|
|
5
6
|
|
|
@@ -10,7 +11,7 @@ class FeatureSets:
|
|
|
10
11
|
"""
|
|
11
12
|
URL = '/features/sets'
|
|
12
13
|
|
|
13
|
-
def __init__(self, client_api:
|
|
14
|
+
def __init__(self, client_api: ApiClient, project: entities.Project = None):
|
|
14
15
|
self._project = project
|
|
15
16
|
self._client_api = client_api
|
|
16
17
|
|
dtlpy/repositories/features.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
import time
|
|
3
|
-
import numpy as np
|
|
4
2
|
|
|
5
|
-
from .. import exceptions, entities,
|
|
3
|
+
from .. import exceptions, entities, miscellaneous, _api_reference
|
|
4
|
+
from ..services.api_client import ApiClient
|
|
6
5
|
|
|
7
6
|
logger = logging.getLogger(name='dtlpy')
|
|
8
7
|
|
|
@@ -13,7 +12,7 @@ class Features:
|
|
|
13
12
|
"""
|
|
14
13
|
URL = '/features/vectors'
|
|
15
14
|
|
|
16
|
-
def __init__(self, client_api:
|
|
15
|
+
def __init__(self, client_api: ApiClient,
|
|
17
16
|
project: entities.Project = None,
|
|
18
17
|
item: entities.Item = None,
|
|
19
18
|
annotation: entities.Annotation = None,
|
|
@@ -127,7 +126,7 @@ class Features:
|
|
|
127
126
|
parent_id: str = None,
|
|
128
127
|
org_id: str = None,
|
|
129
128
|
refs: dict = None
|
|
130
|
-
|
|
129
|
+
):
|
|
131
130
|
"""
|
|
132
131
|
Create a new Feature vector
|
|
133
132
|
|
|
@@ -3,7 +3,8 @@ Integrations Repository
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import logging
|
|
6
|
-
from .. import entities, exceptions,
|
|
6
|
+
from .. import entities, exceptions, miscellaneous, _api_reference
|
|
7
|
+
from ..services.api_client import ApiClient
|
|
7
8
|
|
|
8
9
|
logger = logging.getLogger(name='dtlpy')
|
|
9
10
|
|
|
@@ -18,7 +19,7 @@ class Integrations:
|
|
|
18
19
|
|
|
19
20
|
"""
|
|
20
21
|
|
|
21
|
-
def __init__(self, client_api:
|
|
22
|
+
def __init__(self, client_api: ApiClient, org: entities.Organization = None,
|
|
22
23
|
project: entities.Project = None):
|
|
23
24
|
self._client_api = client_api
|
|
24
25
|
self._org = org
|
dtlpy/repositories/items.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
|
-
from .. import entities, exceptions, repositories, miscellaneous,
|
|
3
|
+
from .. import entities, exceptions, repositories, miscellaneous, _api_reference
|
|
4
|
+
from ..services.api_client import ApiClient
|
|
4
5
|
|
|
5
6
|
logger = logging.getLogger(name='dtlpy')
|
|
6
7
|
|
|
@@ -13,7 +14,7 @@ class Items:
|
|
|
13
14
|
"""
|
|
14
15
|
|
|
15
16
|
def __init__(self,
|
|
16
|
-
client_api:
|
|
17
|
+
client_api: ApiClient,
|
|
17
18
|
datasets: repositories.Datasets = None,
|
|
18
19
|
dataset: entities.Dataset = None,
|
|
19
20
|
dataset_id=None,
|
dtlpy/repositories/models.py
CHANGED
|
@@ -2,7 +2,8 @@ from typing import List
|
|
|
2
2
|
import logging
|
|
3
3
|
import os
|
|
4
4
|
|
|
5
|
-
from .. import entities, repositories, exceptions, miscellaneous
|
|
5
|
+
from .. import entities, repositories, exceptions, miscellaneous
|
|
6
|
+
from ..services.api_client import ApiClient
|
|
6
7
|
|
|
7
8
|
logger = logging.getLogger(name='dtlpy')
|
|
8
9
|
|
|
@@ -13,7 +14,7 @@ class Models:
|
|
|
13
14
|
"""
|
|
14
15
|
|
|
15
16
|
def __init__(self,
|
|
16
|
-
client_api:
|
|
17
|
+
client_api: ApiClient,
|
|
17
18
|
package: entities.Package = None,
|
|
18
19
|
project: entities.Project = None,
|
|
19
20
|
project_id: str = None):
|
|
@@ -482,8 +483,9 @@ class Models:
|
|
|
482
483
|
path=f"/ml/models/{model_id}/train")
|
|
483
484
|
if not success:
|
|
484
485
|
raise exceptions.PlatformException(response)
|
|
485
|
-
|
|
486
|
-
|
|
486
|
+
return entities.Execution.from_json(_json=response.json(),
|
|
487
|
+
client_api=self._client_api,
|
|
488
|
+
project=self._project)
|
|
487
489
|
|
|
488
490
|
def predict(self, model, item_ids):
|
|
489
491
|
"""
|