cloudpss 4.5.2__tar.gz → 4.5.4__tar.gz
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.
- {cloudpss-4.5.2 → cloudpss-4.5.4}/PKG-INFO +1 -1
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/ieslab/PlanModel.py +20 -59
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/model/implements/diagram.py +34 -7
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/model/model.py +3 -2
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/runner/runner.py +27 -12
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/utils/IO.py +3 -1
- cloudpss-4.5.4/cloudpss/version.py +1 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss.egg-info/PKG-INFO +1 -1
- cloudpss-4.5.2/cloudpss/version.py +0 -1
- {cloudpss-4.5.2 → cloudpss-4.5.4}/README.md +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/asyncio/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/asyncio/job/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/asyncio/job/job.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/asyncio/job/messageStreamReceiver.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/asyncio/job/messageStreamSender.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/asyncio/model/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/asyncio/model/model.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/asyncio/model/revision.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/asyncio/model/topology.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/asyncio/utils/AsyncIterable.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/asyncio/utils/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/asyncio/utils/httpAsyncRequest.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/function/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/function/function.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/function/functionExecution.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/function/job.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/ieslab/DataManageModel.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/ieslab/EvaluationModel.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/ieslab/IESLabOpt.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/ieslab/IESLabPlan.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/ieslab/IESLabSimulation.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/ieslab/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/job/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/job/job.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/job/jobReceiver.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/job/messageStreamReceiver.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/job/messageStreamSender.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/job/result/EMTResult.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/job/result/IESLabSimulationResult.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/job/result/IESLabTypicalDayResult.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/job/result/IESResult.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/job/result/PowerFlowResult.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/job/result/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/job/result/result.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/model/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/model/implements/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/model/implements/component.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/model/implements/implement.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/model/jobDefinitions.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/model/revision.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/model/topology.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/project/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/project/project.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/runner/IESLabEvaluationResult.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/runner/IESLabPlanResult.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/runner/IESLabTypicalDayResult.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/runner/MessageStreamReceiver.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/runner/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/runner/receiver.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/runner/result.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/runner/storage.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/runner/transform.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/utils/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/utils/dataEncoder.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/utils/graphqlUtil.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/utils/httprequests.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/utils/matlab.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/utils/yamlLoader.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss/verify.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss.egg-info/SOURCES.txt +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss.egg-info/dependency_links.txt +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss.egg-info/requires.txt +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/cloudpss.egg-info/top_level.txt +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/setup.cfg +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/setup.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test-async.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test-async2.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test-async3.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test-plot.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test-plot1.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test-sdk.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test-sdk1.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test-snapshot.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test-topology.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test-topology1.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test-yield.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test11.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test12.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test7950.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/testAsync.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/testEvent.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/testRt-test.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/testRt.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/testRt2.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/testSend.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test_in_new_web_1.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test_modepower_ampratio(3).py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test_ws.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/test_ws2.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.4}/test/testb.py +0 -0
@@ -17,7 +17,6 @@ class IESLabPlanModel(object):
|
|
17
17
|
'''
|
18
18
|
self.simulationId = simulationId
|
19
19
|
self.optimizationInfo = self.GetOptimizationInfo()
|
20
|
-
# self.OptimizationMode = OptimizationMode
|
21
20
|
|
22
21
|
def _fetchItemData(self, url, params):
|
23
22
|
'''
|
@@ -29,69 +28,31 @@ class IESLabPlanModel(object):
|
|
29
28
|
data = json.loads(r.text)
|
30
29
|
return data['results']
|
31
30
|
|
31
|
+
|
32
32
|
def GetOptimizationInfo(self):
|
33
33
|
'''
|
34
34
|
获取当前算例的优化目标设置信息
|
35
35
|
|
36
|
-
:return:
|
36
|
+
:return: enum 类型,代表经济性优化和环保性优化的类型
|
37
37
|
'''
|
38
38
|
try:
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
"OptimizationMode": OptimizationMode['经济性'],
|
45
|
-
"StoSen": 0.1
|
46
|
-
}
|
47
|
-
else:
|
48
|
-
value = json.loads(r[0]['opt_params'])
|
49
|
-
return {
|
50
|
-
"OptimizationMode": OptimizationMode(value['OptimizationMode']),
|
51
|
-
"StoSen": value['StoSen']
|
52
|
-
}
|
39
|
+
data = self._fetchItemData(self._baseUri)
|
40
|
+
for e in OptimizationMode:
|
41
|
+
if (e.value == data['data']['optimizationpara']
|
42
|
+
['OptimizationMode']):
|
43
|
+
return e
|
53
44
|
except:
|
54
|
-
|
45
|
+
return OptimizationMode['经济性']
|
55
46
|
|
56
|
-
def SetOptimizationInfo(self,
|
47
|
+
def SetOptimizationInfo(self, optType):
|
57
48
|
'''
|
49
|
+
无对应接口
|
58
50
|
设置当前算例的优化目标
|
59
51
|
|
60
|
-
:param
|
61
|
-
|
62
|
-
:return: boolean 类型,为 True 则设置成功
|
52
|
+
:param optType: enum 类型,代表经济性优化和环保性优化的类型
|
63
53
|
'''
|
64
|
-
|
65
|
-
|
66
|
-
params = {"simu_id": self.simulationId}
|
67
|
-
r = self._fetchItemData(url, params)
|
68
|
-
opt_params = {
|
69
|
-
"OptimizationMode": data.get('OptimizationMode', '').value,
|
70
|
-
"StoSen": data.get('StoSen', ''),
|
71
|
-
"ProjectPeriod": "20"
|
72
|
-
}
|
73
|
-
if(len(r) == 0):
|
74
|
-
payload = {
|
75
|
-
"simu_id": self.simulationId,
|
76
|
-
"opt_params": json.dumps(opt_params)
|
77
|
-
}
|
78
|
-
r = request('POST',
|
79
|
-
url,
|
80
|
-
data=json.dumps(payload))
|
81
|
-
return True
|
82
|
-
else:
|
83
|
-
url2 = f'{self._baseUri}/simuOpt/{r[0]["id"]}/'
|
84
|
-
payload = {
|
85
|
-
"simu_id": self.simulationId,
|
86
|
-
"opt_params": json.dumps(opt_params),
|
87
|
-
"id": r[0]["id"]
|
88
|
-
}
|
89
|
-
r = request('PUT',
|
90
|
-
url2,
|
91
|
-
data=json.dumps(payload))
|
92
|
-
return True
|
93
|
-
except:
|
94
|
-
return False
|
54
|
+
self.optimizationInfo = optType
|
55
|
+
return True
|
95
56
|
|
96
57
|
def run(self) -> HttpRunner[IESLabPlanResult]:
|
97
58
|
'''
|
@@ -103,12 +64,9 @@ class IESLabPlanModel(object):
|
|
103
64
|
if isRunning:
|
104
65
|
raise Exception('该算例正在运行!请从浏览器算例页面点击结束运行或者调用IESPlan对象的kill接口终止计算后重试!')
|
105
66
|
else:
|
106
|
-
url = f'
|
107
|
-
|
108
|
-
|
109
|
-
"ProjectPeriod": "20",
|
110
|
-
"StoSen": self.optimizationInfo.get('StoSen', 0.1)
|
111
|
-
}
|
67
|
+
url = f'{self._runUri}/runOptimization'
|
68
|
+
optType = self.optimizationInfo if self.optimizationInfo is not None else OptimizationMode.经济性
|
69
|
+
optTypeValue = optType.value if isinstance(optType, OptimizationMode) else 0
|
112
70
|
try:
|
113
71
|
r = request('GET',
|
114
72
|
url,
|
@@ -116,7 +74,10 @@ class IESLabPlanModel(object):
|
|
116
74
|
"simuid":
|
117
75
|
self.simulationId,
|
118
76
|
"optPara":
|
119
|
-
json.dumps(
|
77
|
+
json.dumps({
|
78
|
+
"OptimizationMode": optTypeValue,
|
79
|
+
"ProjectPeriod": "20"
|
80
|
+
})
|
120
81
|
})
|
121
82
|
data = json.loads(r.text)
|
122
83
|
return HttpRunner({}, self.simulationId)
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import re
|
1
2
|
from .component import Component
|
2
3
|
from typing import Optional
|
3
4
|
import uuid
|
@@ -140,7 +141,7 @@ class DiagramImplement(object):
|
|
140
141
|
position["y"] += 5
|
141
142
|
return True
|
142
143
|
|
143
|
-
def updateComponent(self, key: str,
|
144
|
+
def updateComponent(self, key: str, **kwargs: dict) -> bool:
|
144
145
|
"""
|
145
146
|
更新元件
|
146
147
|
|
@@ -150,10 +151,36 @@ class DiagramImplement(object):
|
|
150
151
|
|
151
152
|
>>>> diagram.updateComponent(key)
|
152
153
|
"""
|
153
|
-
component = self.cells.get(key)
|
154
|
-
if
|
154
|
+
component = self.cells.get(key,None)
|
155
|
+
if component is None:
|
155
156
|
return False
|
156
|
-
for k, v in
|
157
|
-
if k
|
158
|
-
|
159
|
-
|
157
|
+
for k, v in kwargs.items():
|
158
|
+
if component.__dict__.get(k,None) is None:
|
159
|
+
raise Exception(f"Component has no attribute {k}")
|
160
|
+
if k == 'args' and not isinstance(v, dict):
|
161
|
+
raise Exception(f"Component args must be dict")
|
162
|
+
if k == 'pins' and not isinstance(v, dict):
|
163
|
+
raise Exception(f"Component pins must be dict")
|
164
|
+
if k == 'position' and not isinstance(v, dict):
|
165
|
+
raise Exception(f"Component position must be dict")
|
166
|
+
if k == 'size' and not isinstance(v, dict):
|
167
|
+
raise Exception(f"Component size must be dict")
|
168
|
+
if k == 'style' and not isinstance(v, dict):
|
169
|
+
raise Exception(f"Component style must be dict")
|
170
|
+
if k == 'props' and not isinstance(v, dict):
|
171
|
+
raise Exception(f"Component props must be dict")
|
172
|
+
if k == 'context' and not isinstance(v, dict):
|
173
|
+
raise Exception(f"Component context must be dict")
|
174
|
+
|
175
|
+
if k == 'definition' and not re.match(r'^model/([!()\-.0-9@A-Z\[\]_a-z{}~]{1,240})/([!()\-.0-9@A-Z\[\]_a-z{}~]{1,240})$', v):
|
176
|
+
raise Exception(f"Component definition must be in the format of 'model/owner/key'")
|
177
|
+
|
178
|
+
if k == 'zIndex' and v < 0:
|
179
|
+
raise Exception(f"Component zIndex must be greater than 0")
|
180
|
+
|
181
|
+
if isinstance(v, dict):
|
182
|
+
component.__dict__[k].update(v)
|
183
|
+
continue
|
184
|
+
|
185
|
+
component.__dict__[k] = v
|
186
|
+
|
@@ -137,7 +137,7 @@ class Model(object):
|
|
137
137
|
raise ValueError("不存在拓扑实现")
|
138
138
|
return diagramImplement.removeComponent(key)
|
139
139
|
|
140
|
-
def updateComponent(self, key,
|
140
|
+
def updateComponent(self, key, **kwargs):
|
141
141
|
"""
|
142
142
|
更新元件实现
|
143
143
|
|
@@ -148,7 +148,7 @@ class Model(object):
|
|
148
148
|
diagramImplement = self.revision.getImplements().getDiagram()
|
149
149
|
if diagramImplement is None:
|
150
150
|
raise ValueError("不存在拓扑实现")
|
151
|
-
return diagramImplement.updateComponent(key,
|
151
|
+
return diagramImplement.updateComponent(key, **kwargs)
|
152
152
|
|
153
153
|
|
154
154
|
def getComponentsByRid(self, rid: str):
|
@@ -397,6 +397,7 @@ class Model(object):
|
|
397
397
|
data = IO.load(filePath, format)
|
398
398
|
return data
|
399
399
|
|
400
|
+
|
400
401
|
@staticmethod
|
401
402
|
def dump(model, file, format="yaml", compress="gzip"):
|
402
403
|
"""
|
@@ -15,7 +15,7 @@ from .IESLabEvaluationResult import IESLabEvaluationResult, IESLabPlanEvaluation
|
|
15
15
|
from .IESLabTypicalDayResult import IESLabTypicalDayResult
|
16
16
|
from .storage import Storage
|
17
17
|
from ..utils import request
|
18
|
-
from typing import
|
18
|
+
from typing import TypeVar, Generic
|
19
19
|
import re
|
20
20
|
|
21
21
|
RECEIVER = {
|
@@ -35,6 +35,8 @@ IES_LAB_OPT_RESULT = {
|
|
35
35
|
'function/ieslab/evaluation': IESLabOptEvaluationResult,
|
36
36
|
}
|
37
37
|
|
38
|
+
|
39
|
+
|
38
40
|
RESULT_DB = {
|
39
41
|
'function/CloudPSS/emtp': EMTResult,
|
40
42
|
'function/CloudPSS/emtps': EMTResult,
|
@@ -60,7 +62,11 @@ class Runner(Generic[T]):
|
|
60
62
|
self.taskId = taskId
|
61
63
|
self.db = Storage(taskId, name, job, config, revision, modelRid)
|
62
64
|
rid =job['rid'].replace('job-definition/','function/').replace('/cloudpss/','/CloudPSS/')
|
63
|
-
|
65
|
+
resultClass = kwargs.get('RESULT_DB', None)
|
66
|
+
if resultClass is not None:
|
67
|
+
result = resultClass
|
68
|
+
else:
|
69
|
+
result = RESULT_DB.get(rid, Result)
|
64
70
|
self.result: T = result(self.db)
|
65
71
|
self.receiver = kwargs.get('receiver', None)
|
66
72
|
|
@@ -85,18 +91,25 @@ class Runner(Generic[T]):
|
|
85
91
|
return self.receiver.status()
|
86
92
|
|
87
93
|
def __listen(self, **kwargs):
|
88
|
-
|
89
94
|
receiver = kwargs.get('RECEIVER', 'default')
|
90
|
-
receiverclass = None
|
91
95
|
if type(receiver) is str:
|
92
96
|
if receiver not in RECEIVER:
|
93
|
-
|
97
|
+
receiver = RECEIVER['default']
|
94
98
|
else:
|
95
|
-
|
96
|
-
if
|
99
|
+
receiver = RECEIVER[receiver]
|
100
|
+
if receiver is None:
|
97
101
|
raise Exception('not find receiver')
|
98
|
-
self.receiver =
|
102
|
+
self.receiver = receiver(self.taskId, self.db, **kwargs)
|
99
103
|
self.receiver.connect()
|
104
|
+
def statusCode(self):
|
105
|
+
query="mutation($_a:JobInput!){job(input:$_a){status}}"
|
106
|
+
variables= {
|
107
|
+
"_a": {
|
108
|
+
"id": self.jobId,
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
112
|
+
return graphql_request(query,variables=variables)
|
100
113
|
|
101
114
|
def terminate(self):
|
102
115
|
"""
|
@@ -143,19 +156,21 @@ class Runner(Generic[T]):
|
|
143
156
|
tres[k] = float(v) # type: ignore
|
144
157
|
policy["tres"] = tres
|
145
158
|
function = job["rid"].replace("job-definition/cloudpss/", "function/CloudPSS/")
|
146
|
-
implement = kwargs.get("implement", None)
|
159
|
+
implement = kwargs.get("implement", kwargs.get("topology", None))
|
147
160
|
debug = job["args"].get("@debug", None )
|
148
161
|
debugargs={}
|
149
162
|
if debug is not None:
|
150
163
|
t= [ i.split('=') for i in re.split(r'\s+',debug) if i.find('=')>0]
|
151
164
|
for i in t:
|
152
165
|
debugargs[i[0]]=i[1]
|
153
|
-
|
166
|
+
|
154
167
|
context= [
|
155
168
|
function,
|
156
|
-
|
169
|
+
|
157
170
|
f"model/@sdk/{str(int(time.time() * random.random()))}",
|
158
171
|
]
|
172
|
+
if rid != '':
|
173
|
+
context.append(rid)
|
159
174
|
|
160
175
|
PARENT_JOB_ID =kwargs.get("PARENT_JOB_ID",None)
|
161
176
|
if PARENT_JOB_ID is not None:
|
@@ -240,7 +255,7 @@ class HttpRunner(Runner[T]):
|
|
240
255
|
if self.__taskId is None:
|
241
256
|
return False
|
242
257
|
return self.result.status() # type: ignore
|
243
|
-
|
258
|
+
|
244
259
|
|
245
260
|
class HttpOPTRunner(Runner[T]):
|
246
261
|
|
@@ -2,6 +2,7 @@ import io
|
|
2
2
|
import json
|
3
3
|
import ubjson
|
4
4
|
import yaml
|
5
|
+
from yaml.dumper import SafeDumper
|
5
6
|
import gzip
|
6
7
|
import base64
|
7
8
|
import struct
|
@@ -85,6 +86,7 @@ class IO(object):
|
|
85
86
|
result = ubjson.dumpb(obj)
|
86
87
|
if format == 'yaml':
|
87
88
|
result = yaml.dump(obj).encode(encoding="utf-8")
|
89
|
+
|
88
90
|
if result is None:
|
89
91
|
assert False, 'format not support'
|
90
92
|
if compress == 'gzip':
|
@@ -104,7 +106,7 @@ class IO(object):
|
|
104
106
|
if format == 'ubjson':
|
105
107
|
return ubjson.loadb(byt)
|
106
108
|
if format == 'yaml':
|
107
|
-
return yaml.load(io.BytesIO(byt), Loader=yaml.
|
109
|
+
return yaml.load(io.BytesIO(byt), Loader=yaml.FullLoader)
|
108
110
|
assert False, 'format not support'
|
109
111
|
|
110
112
|
@staticmethod
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = '4.5.4'
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = '4.5.2'
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|