dtlpy 1.91.37__py3-none-any.whl → 1.92.19__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 +5 -2
- dtlpy/__version__.py +1 -1
- dtlpy/entities/__init__.py +1 -1
- dtlpy/entities/command.py +3 -2
- dtlpy/entities/dataset.py +52 -2
- dtlpy/entities/feature_set.py +3 -0
- dtlpy/entities/filters.py +2 -2
- dtlpy/entities/item.py +15 -1
- dtlpy/entities/node.py +11 -1
- dtlpy/entities/ontology.py +36 -40
- dtlpy/entities/pipeline.py +20 -1
- dtlpy/entities/pipeline_execution.py +23 -0
- dtlpy/entities/prompt_item.py +240 -37
- dtlpy/entities/service.py +5 -5
- dtlpy/ml/base_model_adapter.py +101 -41
- dtlpy/new_instance.py +80 -9
- dtlpy/repositories/apps.py +56 -10
- dtlpy/repositories/commands.py +10 -2
- dtlpy/repositories/datasets.py +142 -12
- dtlpy/repositories/dpks.py +5 -1
- dtlpy/repositories/feature_sets.py +23 -3
- dtlpy/repositories/models.py +1 -1
- dtlpy/repositories/pipeline_executions.py +53 -0
- dtlpy/repositories/uploader.py +3 -0
- dtlpy/services/api_client.py +59 -3
- {dtlpy-1.91.37.dist-info → dtlpy-1.92.19.dist-info}/METADATA +1 -1
- {dtlpy-1.91.37.dist-info → dtlpy-1.92.19.dist-info}/RECORD +35 -38
- tests/features/environment.py +29 -0
- dtlpy/callbacks/__init__.py +0 -16
- dtlpy/callbacks/piper_progress_reporter.py +0 -29
- dtlpy/callbacks/progress_viewer.py +0 -54
- {dtlpy-1.91.37.data → dtlpy-1.92.19.data}/scripts/dlp +0 -0
- {dtlpy-1.91.37.data → dtlpy-1.92.19.data}/scripts/dlp.bat +0 -0
- {dtlpy-1.91.37.data → dtlpy-1.92.19.data}/scripts/dlp.py +0 -0
- {dtlpy-1.91.37.dist-info → dtlpy-1.92.19.dist-info}/LICENSE +0 -0
- {dtlpy-1.91.37.dist-info → dtlpy-1.92.19.dist-info}/WHEEL +0 -0
- {dtlpy-1.91.37.dist-info → dtlpy-1.92.19.dist-info}/entry_points.txt +0 -0
- {dtlpy-1.91.37.dist-info → dtlpy-1.92.19.dist-info}/top_level.txt +0 -0
dtlpy/services/api_client.py
CHANGED
|
@@ -13,6 +13,7 @@ import logging
|
|
|
13
13
|
import asyncio
|
|
14
14
|
import certifi
|
|
15
15
|
import base64
|
|
16
|
+
import enum
|
|
16
17
|
import time
|
|
17
18
|
import tqdm
|
|
18
19
|
import json
|
|
@@ -73,6 +74,33 @@ class PlatformError(Exception):
|
|
|
73
74
|
super().__init__(msg)
|
|
74
75
|
|
|
75
76
|
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class Callbacks:
|
|
80
|
+
def __init__(self):
|
|
81
|
+
self._callbacks = {}
|
|
82
|
+
|
|
83
|
+
class CallbackEvent(str, enum.Enum):
|
|
84
|
+
DATASET_EXPORT = 'datasetExport'
|
|
85
|
+
ITEMS_UPLOAD = 'itemUpload'
|
|
86
|
+
|
|
87
|
+
def add(self, event, func):
|
|
88
|
+
|
|
89
|
+
if not callable(func):
|
|
90
|
+
raise ValueError(f"The provided callback for {event} is not callable")
|
|
91
|
+
if event not in list(self.CallbackEvent):
|
|
92
|
+
raise ValueError(f"Unknown event: {event!r}, allowed events are: {list(self.CallbackEvent)}")
|
|
93
|
+
self._callbacks[event] = func
|
|
94
|
+
|
|
95
|
+
def get(self, name):
|
|
96
|
+
return self._callbacks.get(name)
|
|
97
|
+
|
|
98
|
+
def run_on_event(self, event, context, progress):
|
|
99
|
+
callback = self.get(event)
|
|
100
|
+
if callback is not None:
|
|
101
|
+
callback(progress=progress, context=context)
|
|
102
|
+
|
|
103
|
+
|
|
76
104
|
class Verbose:
|
|
77
105
|
__DEFAULT_LOGGING_LEVEL = 'warning'
|
|
78
106
|
__DEFAULT_DISABLE_PROGRESS_BAR = False
|
|
@@ -403,6 +431,7 @@ class ApiClient:
|
|
|
403
431
|
self._environments = None
|
|
404
432
|
self._environment = None
|
|
405
433
|
self._verbose = None
|
|
434
|
+
self._callbacks = None
|
|
406
435
|
self._cache_state = None
|
|
407
436
|
self._attributes_mode = None
|
|
408
437
|
self._platform_settings = None
|
|
@@ -690,6 +719,21 @@ class ApiClient:
|
|
|
690
719
|
assert isinstance(self._sdk_cache, SDKCache)
|
|
691
720
|
return self._sdk_cache
|
|
692
721
|
|
|
722
|
+
@property
|
|
723
|
+
def callbacks(self):
|
|
724
|
+
if self._callbacks is None:
|
|
725
|
+
self._callbacks = Callbacks()
|
|
726
|
+
assert isinstance(self._callbacks, Callbacks)
|
|
727
|
+
return self._callbacks
|
|
728
|
+
|
|
729
|
+
def add_callback(self, event, func):
|
|
730
|
+
"""
|
|
731
|
+
function to add callback to the client
|
|
732
|
+
:param event: dl.CallbackEvent enum, name of the callback
|
|
733
|
+
:param func: function to call with 2 arguments: progress and context
|
|
734
|
+
"""
|
|
735
|
+
self.callbacks.add(event, func)
|
|
736
|
+
|
|
693
737
|
@property
|
|
694
738
|
def token(self):
|
|
695
739
|
_token = self._token
|
|
@@ -790,7 +834,7 @@ class ApiClient:
|
|
|
790
834
|
if internal_requests_url is not None:
|
|
791
835
|
self.__gate_url_for_requests = internal_requests_url
|
|
792
836
|
return self.__gate_url_for_requests
|
|
793
|
-
|
|
837
|
+
|
|
794
838
|
def export_curl_request(self, req_type, path, headers=None, json_req=None, files=None, data=None):
|
|
795
839
|
curl, prepared = self._build_gen_request(req_type=req_type,
|
|
796
840
|
path=path,
|
|
@@ -1128,7 +1172,7 @@ class ApiClient:
|
|
|
1128
1172
|
def callback(bytes_read):
|
|
1129
1173
|
pass
|
|
1130
1174
|
|
|
1131
|
-
timeout = aiohttp.ClientTimeout(total=
|
|
1175
|
+
timeout = aiohttp.ClientTimeout(total=2 * 60)
|
|
1132
1176
|
async with aiohttp.ClientSession(headers=headers, timeout=timeout) as session:
|
|
1133
1177
|
try:
|
|
1134
1178
|
form = aiohttp.FormData({})
|
|
@@ -1491,7 +1535,13 @@ class ApiClient:
|
|
|
1491
1535
|
:param token: a valid token
|
|
1492
1536
|
:return:
|
|
1493
1537
|
"""
|
|
1494
|
-
|
|
1538
|
+
current_token = self.token
|
|
1539
|
+
self.token = token
|
|
1540
|
+
success, response = self.gen_request(req_type='get', path='/users/me')
|
|
1541
|
+
if not response.ok:
|
|
1542
|
+
# switch back to before
|
|
1543
|
+
self.token = current_token
|
|
1544
|
+
raise ValueError(f"Invalid API key provided. Error: {response.text}")
|
|
1495
1545
|
|
|
1496
1546
|
def login_api_key(self, api_key):
|
|
1497
1547
|
"""
|
|
@@ -1499,7 +1549,13 @@ class ApiClient:
|
|
|
1499
1549
|
:param api_key: a valid API key
|
|
1500
1550
|
:return:
|
|
1501
1551
|
"""
|
|
1552
|
+
current_token = self.token
|
|
1502
1553
|
self.token = api_key
|
|
1554
|
+
success, response = self.gen_request(req_type='get', path='/users/me')
|
|
1555
|
+
if not response.ok:
|
|
1556
|
+
# switch back to before
|
|
1557
|
+
self.token = current_token
|
|
1558
|
+
raise ValueError(f"Invalid API key provided. Error: {response.text}")
|
|
1503
1559
|
|
|
1504
1560
|
@property
|
|
1505
1561
|
def login_domain(self):
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
dtlpy/__init__.py,sha256=
|
|
2
|
-
dtlpy/__version__.py,sha256=
|
|
1
|
+
dtlpy/__init__.py,sha256=judUZGmYQMFrva_nip8O371rvJ1BZnoL0fbU_1TX9CI,20194
|
|
2
|
+
dtlpy/__version__.py,sha256=6QhHVB1jEy66ZyHy-pBaGKIulMxN7-AqEPkz2eiZeys,20
|
|
3
3
|
dtlpy/exceptions.py,sha256=EQCKs3pwhwZhgMByQN3D3LpWpdxwcKPEEt-bIaDwURM,2871
|
|
4
|
-
dtlpy/new_instance.py,sha256=
|
|
4
|
+
dtlpy/new_instance.py,sha256=I4Gc658s-yUD0-gEiC2pRDKaADZPdr1dm67K4mkx5xw,10065
|
|
5
5
|
dtlpy/assets/__init__.py,sha256=D_hAa6NM8Zoy32sF_9b7m0b7I-BQEyBFg8-9Tg2WOeo,976
|
|
6
6
|
dtlpy/assets/lock_open.png,sha256=BH9uyf5uYvgZrDpDw9qCUnT3UbkXG8XbeRmWDpWlV4M,18215
|
|
7
7
|
dtlpy/assets/main.py,sha256=N1JUsx79qnXI7Hx22C8JOzHJdGHxvrXeTx5UZAxvJfE,1380
|
|
@@ -37,9 +37,6 @@ dtlpy/caches/cache.py,sha256=IqNaueml6aKU3_WAQ3lFfJP3qyXsvflZnAvA6vgboeM,16917
|
|
|
37
37
|
dtlpy/caches/dl_cache.py,sha256=aaqB0THK6eNmQ54SC6egb6z8sJE3ciKQ5cIHrQHe4r8,5695
|
|
38
38
|
dtlpy/caches/filesystem_cache.py,sha256=OrBqyEucSVp7g33c6R1BR3ICbkgQnwYWEDhQ7OxHy2Y,2737
|
|
39
39
|
dtlpy/caches/redis_cache.py,sha256=bgJgxgAXFR_TxPDvlLS4TKumFds-ihNf668JbPYUfpc,2331
|
|
40
|
-
dtlpy/callbacks/__init__.py,sha256=j3QTgKnQSNiVasjlTVIVl7hRQX-qlw36F9Fu_PKmktc,715
|
|
41
|
-
dtlpy/callbacks/piper_progress_reporter.py,sha256=L9OK-n6zqBP0SFhq0lrMXuMjf4uWfy-12jqbL5cd9FQ,1075
|
|
42
|
-
dtlpy/callbacks/progress_viewer.py,sha256=ZZw8ljXVP2kpndLRxOhY09dOgUN7Luop-4TUuT5nSDc,2314
|
|
43
40
|
dtlpy/dlp/__init__.py,sha256=QG_BxSqeic0foFBmzIkpZEF4EvxOZamknj2f5Cb6T6Q,868
|
|
44
41
|
dtlpy/dlp/cli_utilities.py,sha256=Kzr-AKbRlXLdGKY2RTUNm0U_vKHxyMOB17TQegeDMdM,16037
|
|
45
42
|
dtlpy/dlp/command_executor.py,sha256=JKtRKTwrKfkXHa1VuFhPw15FuwexBPq_9ANAu2pSyXs,32113
|
|
@@ -47,7 +44,7 @@ dtlpy/dlp/dlp,sha256=-F0vSCWuSOOtgERAtsPMPyMmzitjhB7Yeftg_PDlDjw,10
|
|
|
47
44
|
dtlpy/dlp/dlp.bat,sha256=QOvx8Dlx5dUbCTMpwbhOcAIXL1IWmgVRSboQqDhIn3A,37
|
|
48
45
|
dtlpy/dlp/dlp.py,sha256=YjNBjeCDTXJ7tj8qdiGZ8lFb8DtPZl-FvViyjxt9xF8,4278
|
|
49
46
|
dtlpy/dlp/parser.py,sha256=p-TFaiAU2c3QkI97TXzL2LDR3Eq0hGDFrTc9J2jWLh4,30551
|
|
50
|
-
dtlpy/entities/__init__.py,sha256=
|
|
47
|
+
dtlpy/entities/__init__.py,sha256=lOu2d39xvp-gOi-BEtGriXSLgBOYx6vfAOGYCFBzorc,4522
|
|
51
48
|
dtlpy/entities/analytic.py,sha256=5MpYDKPVsZ1MIy20Ju515RWed6P667j4TLxsan2gyNM,11925
|
|
52
49
|
dtlpy/entities/annotation.py,sha256=yk-JQzgzXvnDLFrOkmcHQfEtsiPqZeIisv80ksNB-f8,66912
|
|
53
50
|
dtlpy/entities/annotation_collection.py,sha256=CEYSBHhhDkC0VJdHsBSrA6TgdKGMcKeI3tFM40UJwS8,29838
|
|
@@ -58,23 +55,23 @@ dtlpy/entities/assignment.py,sha256=Dc1QcfVf67GGcmDDi4ubESDuPkSgjXqdqjTBQ31faUM,
|
|
|
58
55
|
dtlpy/entities/base_entity.py,sha256=i83KrtAz6dX4t8JEiUimLI5ZRrN0VnoUWKG2Zz49N5w,6518
|
|
59
56
|
dtlpy/entities/bot.py,sha256=is3NUCnPg56HSjsHIvFcVkymValMqDV0uHRDC1Ib-ds,3819
|
|
60
57
|
dtlpy/entities/codebase.py,sha256=pwRkAq2GV0wvmzshg89IAmE-0I2Wsy_-QNOu8OV8uqc,8999
|
|
61
|
-
dtlpy/entities/command.py,sha256=
|
|
62
|
-
dtlpy/entities/dataset.py,sha256=
|
|
58
|
+
dtlpy/entities/command.py,sha256=ARu8ttk-C7_Ice7chRyTtyOtakBTF09FC04mEk73SO8,5010
|
|
59
|
+
dtlpy/entities/dataset.py,sha256=87o6FA9MYCIc0KBCUqQr_VsX-W2mGbJn64JvD-zp-EA,47354
|
|
63
60
|
dtlpy/entities/directory_tree.py,sha256=Rni6pLSWytR6yeUPgEdCCRfTg_cqLOdUc9uCqz9KT-Q,1186
|
|
64
61
|
dtlpy/entities/dpk.py,sha256=3iL-n8a8HoWqUusAepfs3v_kDP7b_H0I_D3YucO6vuE,17325
|
|
65
62
|
dtlpy/entities/driver.py,sha256=O_QdK1EaLjQyQkmvKsmkNgmvmMb1mPjKnJGxK43KrOA,7197
|
|
66
63
|
dtlpy/entities/execution.py,sha256=WBiAws-6wZnQQ3y9wyvOeexA3OjxfaRdwDu5dSFYL1g,13420
|
|
67
64
|
dtlpy/entities/feature.py,sha256=9fFjD0W57anOVSAVU55ypxN_WTCsWTG03Wkc3cAAj78,3732
|
|
68
|
-
dtlpy/entities/feature_set.py,sha256=
|
|
69
|
-
dtlpy/entities/filters.py,sha256=
|
|
65
|
+
dtlpy/entities/feature_set.py,sha256=niw4MkmrDbD_LWQu1X30uE6U4DCzmFhPTaYeZ6VZDB0,4443
|
|
66
|
+
dtlpy/entities/filters.py,sha256=Xkiu9IKR-MX2su6wVr5seQ4mKwFh0IFygtsVQkfoYSE,22348
|
|
70
67
|
dtlpy/entities/integration.py,sha256=CA5F1eQCGE_4c_Kry4nWRdeyjHctNnvexcDXg_M5HLU,5734
|
|
71
|
-
dtlpy/entities/item.py,sha256=
|
|
68
|
+
dtlpy/entities/item.py,sha256=3m9T5Y4xrfiNhgMQf_gWzwI3Ol_6U8LE_u5uWtims2M,29704
|
|
72
69
|
dtlpy/entities/label.py,sha256=ycDYavIgKhz806plIX-64c07_TeHpDa-V7LnfFVe4Rg,3869
|
|
73
70
|
dtlpy/entities/links.py,sha256=FAmEwHtsrqKet3c0UHH9u_gHgG6_OwF1-rl4xK7guME,2516
|
|
74
71
|
dtlpy/entities/message.py,sha256=ApJuaKEqxATpXjNYUjGdYPu3ibQzEMo8-LtJ_4xAcPI,5865
|
|
75
72
|
dtlpy/entities/model.py,sha256=GXfQoLa06GSsymBiRTqI2FYegLwyrc5S8lWMwGWxhjw,24959
|
|
76
|
-
dtlpy/entities/node.py,sha256=
|
|
77
|
-
dtlpy/entities/ontology.py,sha256=
|
|
73
|
+
dtlpy/entities/node.py,sha256=yPPYDLtNMc6vZbbf4FIffY86y7tkaTvYm42Jb7k3Ofk,39617
|
|
74
|
+
dtlpy/entities/ontology.py,sha256=ok4p3sLBc_SS5hs2gZr5-gbblrveM7qSIX4z67QSKeQ,31967
|
|
78
75
|
dtlpy/entities/organization.py,sha256=AMkx8hNIIIjnu5pYlNjckMRuKt6H3lnOAqtEynkr7wg,9893
|
|
79
76
|
dtlpy/entities/package.py,sha256=EA5cB3nFBlsbxVK-QroZILjol2bYSVGqCby-mOyJJjQ,26353
|
|
80
77
|
dtlpy/entities/package_defaults.py,sha256=wTD7Z7rGYjVy8AcUxTFEnkOkviiJaLVZYvduiUBKNZo,211
|
|
@@ -82,14 +79,14 @@ dtlpy/entities/package_function.py,sha256=M42Kvw9A8b6msAkv-wRNAQg_-UC2bejniCjeKD
|
|
|
82
79
|
dtlpy/entities/package_module.py,sha256=cOkIITATkzzCQpE0sdPiBUisAz8ImlPG2YGZ0K7SypA,5151
|
|
83
80
|
dtlpy/entities/package_slot.py,sha256=XBwCodQe618sQm0bmx46Npo94mEk-zUV7ZX0mDRcsD8,3946
|
|
84
81
|
dtlpy/entities/paged_entities.py,sha256=A6_D0CUJsN52dBG6yn-oHHzjuVDkBNejTG5r-KxWOxI,5848
|
|
85
|
-
dtlpy/entities/pipeline.py,sha256=
|
|
86
|
-
dtlpy/entities/pipeline_execution.py,sha256=
|
|
82
|
+
dtlpy/entities/pipeline.py,sha256=OrRybxEa29S4sKtl7RTdf6kRgnQi90n4wlN4OsMJJLk,20671
|
|
83
|
+
dtlpy/entities/pipeline_execution.py,sha256=XCXlBAHFYVL2HajE71hK-bPxI4gTwZvg5SKri4BgyRA,9928
|
|
87
84
|
dtlpy/entities/project.py,sha256=ZUx8zA3mr6N145M62R3UDPCCzO1vxfyWO6vjES-bO-g,14653
|
|
88
|
-
dtlpy/entities/prompt_item.py,sha256=
|
|
85
|
+
dtlpy/entities/prompt_item.py,sha256=6fswLddnVKPLyGElgUCVPIZUYAZ-U0eor3nxZqecKHY,12335
|
|
89
86
|
dtlpy/entities/recipe.py,sha256=Q1HtYgind3bEe-vnDZWhw6H-rcIAGhkGHPRWtLIkPSE,11917
|
|
90
87
|
dtlpy/entities/reflect_dict.py,sha256=2NaSAL-CO0T0FYRYFQlaSpbsoLT2Q18AqdHgQSLX5Y4,3273
|
|
91
88
|
dtlpy/entities/resource_execution.py,sha256=1HuVV__U4jAUOtOkWlWImnM3Yts8qxMSAkMA9sBhArY,5033
|
|
92
|
-
dtlpy/entities/service.py,sha256=
|
|
89
|
+
dtlpy/entities/service.py,sha256=OaEcKsGgapwWRIzBUU8wvJqd0h_mpY7ICugVjzV7pDA,30211
|
|
93
90
|
dtlpy/entities/setting.py,sha256=koydO8b0_bWVNklR2vpsXswxzBo8q83XtGk3wkma0MI,8522
|
|
94
91
|
dtlpy/entities/task.py,sha256=XHiEqZYFlrDCtmw1MXsysjoBLdIzAk7coMrVk8bNIiE,19534
|
|
95
92
|
dtlpy/entities/time_series.py,sha256=336jWNckjuSn0G29WJFetB7nBoFAKqs4VH9_IB4m4FE,4017
|
|
@@ -148,7 +145,7 @@ dtlpy/miscellaneous/list_print.py,sha256=leEg3RodgYfH5t_0JG8VuM8NiesR8sJLK_mRStt
|
|
|
148
145
|
dtlpy/miscellaneous/zipping.py,sha256=GMdPhAeHQXeMS5ClaiKWMJWVYQLBLAaJUWxvdYrL4Ro,5337
|
|
149
146
|
dtlpy/ml/__init__.py,sha256=vPkyXpc9kcWWZ_PxyPEOsjKBJdEbowLkZr8FZIb_OBM,799
|
|
150
147
|
dtlpy/ml/base_feature_extractor_adapter.py,sha256=iiEGYAx0Rdn4K46H_FlKrAv3ebTXHSxNVAmio0BxhaI,1178
|
|
151
|
-
dtlpy/ml/base_model_adapter.py,sha256=
|
|
148
|
+
dtlpy/ml/base_model_adapter.py,sha256=tpC_bBjlqLK7obMe2yJ8I52oWXNXijPoTQtlDSYfc5E,48070
|
|
152
149
|
dtlpy/ml/metrics.py,sha256=BG2E-1Mvjv2e2No9mIJKVmvzqBvLqytKcw3hA7wVUNc,20037
|
|
153
150
|
dtlpy/ml/predictions_utils.py,sha256=He_84U14oS2Ss7T_-Zj5GDiBZwS-GjMPURUh7u7DjF8,12484
|
|
154
151
|
dtlpy/ml/summary_writer.py,sha256=dehDi8zmGC1sAGyy_3cpSWGXoGQSiQd7bL_Thoo8yIs,2784
|
|
@@ -156,29 +153,29 @@ dtlpy/ml/train_utils.py,sha256=R-BHKRfqDoLLhFyLzsRFyJ4E-8iedj9s9oZqy3IO2rg,2404
|
|
|
156
153
|
dtlpy/repositories/__init__.py,sha256=_p6RafEniBXbeTAbz8efnIr4G4mCwV9x6LEkXhTRWUE,1949
|
|
157
154
|
dtlpy/repositories/analytics.py,sha256=dQPCYTPAIuyfVI_ppR49W7_GBj0033feIm9Gd7LW1V0,2966
|
|
158
155
|
dtlpy/repositories/annotations.py,sha256=E7iHo8UwDAhdulqh0lGr3fGQ-TSwZXXGsEXZA-WJ_NA,35780
|
|
159
|
-
dtlpy/repositories/apps.py,sha256=
|
|
156
|
+
dtlpy/repositories/apps.py,sha256=VamO007F1rW7gPdMqPE-pFMaqXz4S5Xm9pY3GD9ITIY,15555
|
|
160
157
|
dtlpy/repositories/artifacts.py,sha256=Ke2ustTNw-1eQ0onLsWY7gL2aChjXPAX5p1uQ_EzMbo,19081
|
|
161
158
|
dtlpy/repositories/assignments.py,sha256=1VwJZ7ctQe1iaDDDpeYDgoj2G-TCgzolVLUEqUocd2w,25506
|
|
162
159
|
dtlpy/repositories/bots.py,sha256=q1SqH01JHloljKxknhHU09psV1vQx9lPhu3g8mBBeRg,8104
|
|
163
160
|
dtlpy/repositories/codebases.py,sha256=pvcZxdrq0-zWysVbdXjUOhnfcF6hJD8v5VclNZ-zhGA,24668
|
|
164
|
-
dtlpy/repositories/commands.py,sha256=
|
|
161
|
+
dtlpy/repositories/commands.py,sha256=8GJU2OQTH0grHFQE30l0UVqaPAwio4psk4VpiYklkFk,5589
|
|
165
162
|
dtlpy/repositories/compositions.py,sha256=H417BvlQAiWr5NH2eANFke6CfEO5o7DSvapYpf7v5Hk,2150
|
|
166
|
-
dtlpy/repositories/datasets.py,sha256=
|
|
163
|
+
dtlpy/repositories/datasets.py,sha256=Rauh-apKSKP7cWS99uhiZYZ-679qNpPm7HoMkMzyJ-s,51789
|
|
167
164
|
dtlpy/repositories/downloader.py,sha256=pNwL7Nid8xmOyYNiv4DB_WY4RoKlxQ-U9nG2V99Gyr8,41342
|
|
168
|
-
dtlpy/repositories/dpks.py,sha256=
|
|
165
|
+
dtlpy/repositories/dpks.py,sha256=b9i-K4HHBA-7T7AZdICFfMUWtqr9--igVwOq0TKyq7Y,16612
|
|
169
166
|
dtlpy/repositories/drivers.py,sha256=fF0UuHCyBzop8pHfryex23mf0kVFAkqzNdOmwBbaWxY,10204
|
|
170
167
|
dtlpy/repositories/executions.py,sha256=M84nhpFPPZq4fQeJ2m_sv6JT4NE2WDRMOXWr451J0bU,30403
|
|
171
|
-
dtlpy/repositories/feature_sets.py,sha256=
|
|
168
|
+
dtlpy/repositories/feature_sets.py,sha256=UowMDAl_CRefRB5oZzubnsjU_OFgiPPdQXn8q2j4Kuw,9666
|
|
172
169
|
dtlpy/repositories/features.py,sha256=7xA2ihEuNgZD7HBQMMGLWpsS2V_3PgieKW2YAk1OeUU,9712
|
|
173
170
|
dtlpy/repositories/integrations.py,sha256=gNQmw5ykFtBaimdxUkzCXQqefZaM8yQPnxWZkIJK7ww,11666
|
|
174
171
|
dtlpy/repositories/items.py,sha256=DqJ3g9bc4OLMm9KqI-OebXbr-zcEiohO1wGZJ1uE2Lg,37874
|
|
175
172
|
dtlpy/repositories/messages.py,sha256=zYcoz8Us6j8Tb5Z7luJuvtO9xSRTuOCS7pl-ztt97Ac,3082
|
|
176
|
-
dtlpy/repositories/models.py,sha256=
|
|
173
|
+
dtlpy/repositories/models.py,sha256=o0S29Y7HF6RXV06N6MDXCozolzfK1X4JR-3YRODBBxo,34829
|
|
177
174
|
dtlpy/repositories/nodes.py,sha256=xXJm_YA0vDUn0dVvaGeq6ORM0vI3YXvfjuylvGRtkxo,3061
|
|
178
175
|
dtlpy/repositories/ontologies.py,sha256=unnMhD2isR9DVE5S8Fg6fSDf1ZZ5Xemxxufx4LEUT3w,19577
|
|
179
176
|
dtlpy/repositories/organizations.py,sha256=6ijUDFbsogfRul1g_vUB5AZOb41MRmV5NhNU7WLHt3A,22825
|
|
180
177
|
dtlpy/repositories/packages.py,sha256=QhkXMZkpseCt0pDropJuqoHJL0RMa5plk8AN0V3w6Nk,86807
|
|
181
|
-
dtlpy/repositories/pipeline_executions.py,sha256=
|
|
178
|
+
dtlpy/repositories/pipeline_executions.py,sha256=zQNRejj23r5q1cSp88KMoeOGUOUbbg3Yi-ER7qZfyF8,16781
|
|
182
179
|
dtlpy/repositories/pipelines.py,sha256=VDAOsGbgD1_AKdMrJl_qB3gxPs7f3pwUnPx0pT1iAWk,23977
|
|
183
180
|
dtlpy/repositories/projects.py,sha256=tZyFLqVs-8ggTIi5echlX7XdGOJGW4LzKuXke7jkRnw,22140
|
|
184
181
|
dtlpy/repositories/recipes.py,sha256=ZZDhHn9g28C99bsf0nFaIpVYn6f6Jisz9upkHEkeaYY,15843
|
|
@@ -190,11 +187,11 @@ dtlpy/repositories/tasks.py,sha256=nA3rODvS8Q361xDmPXII-VPzktzoxbAApxTkzC5wv4M,4
|
|
|
190
187
|
dtlpy/repositories/times_series.py,sha256=m-bKFEgiZ13yQNelDjBfeXMUy_HgsPD_JAHj1GVx9fU,11420
|
|
191
188
|
dtlpy/repositories/triggers.py,sha256=izdNyCN1gDc5uo7AXntso0HSMTDIzGFUp-dSEz8cn_U,21990
|
|
192
189
|
dtlpy/repositories/upload_element.py,sha256=4CDZRKLubanOP0ZyGwxAHTtl6GLzwAyRAIm-PLYt0ck,10140
|
|
193
|
-
dtlpy/repositories/uploader.py,sha256=
|
|
190
|
+
dtlpy/repositories/uploader.py,sha256=iOlDYWIMy_h1Rbd7Mfug1I0e93dBJ0SxqP_BOwqYQPQ,30697
|
|
194
191
|
dtlpy/repositories/webhooks.py,sha256=IIpxOJ-7KeQp1TY9aJZz-FuycSjAoYx0TDk8z86KAK8,9033
|
|
195
192
|
dtlpy/services/__init__.py,sha256=VfVJy2otIrDra6i7Sepjyez2ujiE6171ChQZp-YgxsM,904
|
|
196
193
|
dtlpy/services/aihttp_retry.py,sha256=tgntZsAY0dW9v08rkjX1T5BLNDdDd8svtgn7nH8DSGU,5022
|
|
197
|
-
dtlpy/services/api_client.py,sha256=
|
|
194
|
+
dtlpy/services/api_client.py,sha256=EG4Spm163N7Ig99tkubSYqEGQQBElK2jFtJGAek96OY,68145
|
|
198
195
|
dtlpy/services/api_reference.py,sha256=cW-B3eoi9Xs3AwI87_Kr6GV_E6HPoC73aETFaGz3A-0,1515
|
|
199
196
|
dtlpy/services/async_utils.py,sha256=lfpkTkRUvQoMTxaRZBHbPt5e43qdvpCGDe_-KcY2Jps,2810
|
|
200
197
|
dtlpy/services/calls_counter.py,sha256=gr0io5rIsO5-7Cgc8neA1vK8kUtYhgFPmDQ2jXtiZZs,1036
|
|
@@ -222,19 +219,19 @@ dtlpy/utilities/reports/report.py,sha256=3nEsNnIWmdPEsd21nN8vMMgaZVcPKn9iawKTTeO
|
|
|
222
219
|
dtlpy/utilities/videos/__init__.py,sha256=SV3w51vfPuGBxaMeNemx6qEMHw_C4lLpWNGXMvdsKSY,734
|
|
223
220
|
dtlpy/utilities/videos/video_player.py,sha256=LCxg0EZ_DeuwcT7U_r7MRC6Q19s0xdFb7x5Gk39PRms,24072
|
|
224
221
|
dtlpy/utilities/videos/videos.py,sha256=Dj916B4TQRIhI7HZVevl3foFrCsPp0eeWwvGbgX3-_A,21875
|
|
225
|
-
dtlpy-1.
|
|
226
|
-
dtlpy-1.
|
|
227
|
-
dtlpy-1.
|
|
222
|
+
dtlpy-1.92.19.data/scripts/dlp,sha256=-F0vSCWuSOOtgERAtsPMPyMmzitjhB7Yeftg_PDlDjw,10
|
|
223
|
+
dtlpy-1.92.19.data/scripts/dlp.bat,sha256=QOvx8Dlx5dUbCTMpwbhOcAIXL1IWmgVRSboQqDhIn3A,37
|
|
224
|
+
dtlpy-1.92.19.data/scripts/dlp.py,sha256=tEokRaDINISXnq8yNx_CBw1qM5uwjYiZoJOYGqWB3RU,4267
|
|
228
225
|
tests/assets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
229
226
|
tests/assets/models_flow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
230
227
|
tests/assets/models_flow/failedmain.py,sha256=n8F4eu_u7JPrJ1zedbJPvv9e3lHb3ihoErqrBIcseEc,1847
|
|
231
228
|
tests/assets/models_flow/main.py,sha256=87O3-JaWcC6m_kA39sqPhX70_VCBzzbLWmX2YQFilJw,1873
|
|
232
229
|
tests/assets/models_flow/main_model.py,sha256=Hl_tv7Q6KaRL3yLkpUoLMRqu5-ab1QsUYPL6RPEoamw,2042
|
|
233
230
|
tests/features/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
234
|
-
tests/features/environment.py,sha256=
|
|
235
|
-
dtlpy-1.
|
|
236
|
-
dtlpy-1.
|
|
237
|
-
dtlpy-1.
|
|
238
|
-
dtlpy-1.
|
|
239
|
-
dtlpy-1.
|
|
240
|
-
dtlpy-1.
|
|
231
|
+
tests/features/environment.py,sha256=dyYLrhyaKFnobrz7jD-vgmmxjpL5HDwjQCbzOZa37dM,16261
|
|
232
|
+
dtlpy-1.92.19.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
233
|
+
dtlpy-1.92.19.dist-info/METADATA,sha256=n5rMcsDOFll5b0upeENKE5xJIFLlRu4-EJ7dAwGaaHs,2976
|
|
234
|
+
dtlpy-1.92.19.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
235
|
+
dtlpy-1.92.19.dist-info/entry_points.txt,sha256=C4PyKthCs_no88HU39eioO68oei64STYXC2ooGZTc4Y,43
|
|
236
|
+
dtlpy-1.92.19.dist-info/top_level.txt,sha256=ZWuLmQGUOtWAdgTf4Fbx884w1o0vBYq9dEc1zLv9Mig,12
|
|
237
|
+
dtlpy-1.92.19.dist-info/RECORD,,
|
tests/features/environment.py
CHANGED
|
@@ -256,6 +256,11 @@ def after_tag(context, tag):
|
|
|
256
256
|
use_fixture(drivers_delete, context)
|
|
257
257
|
except Exception:
|
|
258
258
|
logging.exception('Failed to delete driver')
|
|
259
|
+
elif tag == 'models.delete':
|
|
260
|
+
try:
|
|
261
|
+
use_fixture(models_delete, context)
|
|
262
|
+
except Exception:
|
|
263
|
+
logging.exception('Failed to delete model')
|
|
259
264
|
elif tag == 'setenv.reset':
|
|
260
265
|
try:
|
|
261
266
|
use_fixture(reset_setenv, context)
|
|
@@ -456,3 +461,27 @@ def print_feature_filename(context, feature):
|
|
|
456
461
|
p_stream = StreamOpener.ensure_stream_with_encoder(stream)
|
|
457
462
|
p_stream.write(f"Feature Finished : {feature.filename.split('/')[-1]}\n")
|
|
458
463
|
p_stream.write(f"Status: {str(feature.status).split('.')[-1]} - Duration: {feature.duration:.2f} seconds\n")
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
@fixture
|
|
467
|
+
def models_delete(context):
|
|
468
|
+
all_deleted = True
|
|
469
|
+
if hasattr(context, 'to_delete_model_ids'):
|
|
470
|
+
for model_id in context.to_delete_model_ids:
|
|
471
|
+
try:
|
|
472
|
+
context.project.models.delete(model_id=model_id)
|
|
473
|
+
except context.dl.exceptions.NotFound:
|
|
474
|
+
pass
|
|
475
|
+
except:
|
|
476
|
+
all_deleted = False
|
|
477
|
+
logging.exception('Failed deleting model: {}'.format(model_id))
|
|
478
|
+
|
|
479
|
+
for model in context.project.models.list().all():
|
|
480
|
+
try:
|
|
481
|
+
model.delete()
|
|
482
|
+
except context.dl.exceptions.NotFound:
|
|
483
|
+
pass
|
|
484
|
+
except:
|
|
485
|
+
all_deleted = False
|
|
486
|
+
logging.exception('Failed deleting model: {}'.format(model.id))
|
|
487
|
+
assert all_deleted
|
dtlpy/callbacks/__init__.py
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#! /usr/bin/env python3
|
|
2
|
-
# This file is part of DTLPY.
|
|
3
|
-
#
|
|
4
|
-
# DTLPY is free software: you can redistribute it and/or modify
|
|
5
|
-
# it under the terms of the GNU General Public License as published by
|
|
6
|
-
# the Free Software Foundation, either version 3 of the License, or
|
|
7
|
-
# (at your option) any later version.
|
|
8
|
-
#
|
|
9
|
-
# DTLPY is distributed in the hope that it will be useful,
|
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
# GNU General Public License for more details.
|
|
13
|
-
#
|
|
14
|
-
# You should have received a copy of the GNU General Public License
|
|
15
|
-
# along with DTLPY. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
-
# from .progress_viewer import ProgressViewer
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
def get_callback(progress):
|
|
2
|
-
from keras.callbacks import Callback
|
|
3
|
-
import numpy as np
|
|
4
|
-
import logging
|
|
5
|
-
import time
|
|
6
|
-
|
|
7
|
-
logger = logging.getLogger(name='dtlpy')
|
|
8
|
-
|
|
9
|
-
class PiperProgressReporter(Callback):
|
|
10
|
-
def __init__(self, progress):
|
|
11
|
-
super(PiperProgressReporter, self).__init__()
|
|
12
|
-
self.progress = progress
|
|
13
|
-
self.results = dict()
|
|
14
|
-
self.epoch_time_start = None
|
|
15
|
-
|
|
16
|
-
def on_train_begin(self, logs=None):
|
|
17
|
-
self.results = dict()
|
|
18
|
-
|
|
19
|
-
def on_epoch_begin(self, batch, logs=None):
|
|
20
|
-
self.epoch_time_start = time.time()
|
|
21
|
-
|
|
22
|
-
def on_epoch_end(self, epoch, logs=None):
|
|
23
|
-
logs_dict = dict(zip(list(logs.keys()), [float(num) for num in np.array(list(logs.values())).tolist()]))
|
|
24
|
-
self.results[epoch] = logs_dict
|
|
25
|
-
self.results[epoch]['runtime'] = time.time() - self.epoch_time_start
|
|
26
|
-
self.progress.report_output(output={'epoch': epoch,
|
|
27
|
-
'logs': logs_dict})
|
|
28
|
-
|
|
29
|
-
return PiperProgressReporter(progress)
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
def main():
|
|
2
|
-
from keras.callbacks import Callback
|
|
3
|
-
import dtlpy as dl
|
|
4
|
-
import numpy as np
|
|
5
|
-
import logging
|
|
6
|
-
import time
|
|
7
|
-
import json
|
|
8
|
-
import os
|
|
9
|
-
|
|
10
|
-
logger = logging.getLogger(name='dtlpy')
|
|
11
|
-
|
|
12
|
-
class ProgressViewer(Callback):
|
|
13
|
-
def __init__(self, session_id, directory=None):
|
|
14
|
-
super(ProgressViewer, self).__init__()
|
|
15
|
-
# init Dataloop instance
|
|
16
|
-
# get sessions artifact
|
|
17
|
-
self.session = dl.sessions.get(session_id=session_id)
|
|
18
|
-
artifacts = self.session.artifacts.list()
|
|
19
|
-
self.artifact = None
|
|
20
|
-
for artifact in artifacts:
|
|
21
|
-
if artifact.type == 'progress':
|
|
22
|
-
self.artifact = artifact
|
|
23
|
-
logger.info('Progress artifact found. overwriting. artifact_id: %s' % self.artifact.id)
|
|
24
|
-
break
|
|
25
|
-
if self.artifact is None:
|
|
26
|
-
self.artifact = self.session.artifacts.create(artifact_name='progress.yml',
|
|
27
|
-
artifact_type='progress',
|
|
28
|
-
description='update progress on each epoch')
|
|
29
|
-
|
|
30
|
-
logger.info('[INFO] Creating progress artifact. artifact_id: %s' % self.artifact.id)
|
|
31
|
-
if directory is None:
|
|
32
|
-
directory = './results'
|
|
33
|
-
if not os.path.isdir(directory):
|
|
34
|
-
os.makedirs(directory)
|
|
35
|
-
self.filename = os.path.join(directory, 'progress.yml')
|
|
36
|
-
self.results = dict()
|
|
37
|
-
self.epoch_time_start = None
|
|
38
|
-
|
|
39
|
-
def on_train_begin(self, logs=None):
|
|
40
|
-
self.results = dict()
|
|
41
|
-
|
|
42
|
-
def on_epoch_begin(self, batch, logs=None):
|
|
43
|
-
self.epoch_time_start = time.time()
|
|
44
|
-
|
|
45
|
-
def on_epoch_end(self, epoch, logs=None):
|
|
46
|
-
self.results[epoch] = dict(zip(list(logs.keys()), np.array(list(logs.values())).tolist()))
|
|
47
|
-
self.results[epoch]['runtime'] = time.time() - self.epoch_time_start
|
|
48
|
-
with open(self.filename, 'w') as f:
|
|
49
|
-
json.dump(self.results, f)
|
|
50
|
-
self.session.artifacts.upload(filepath=self.filename,
|
|
51
|
-
artifact_name='progress.yml',
|
|
52
|
-
artifact_type='progress')
|
|
53
|
-
|
|
54
|
-
return ProgressViewer
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|