cloudpss 4.5.12__py3-none-any.whl → 4.5.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.
- cloudpss/__init__.py +2 -1
- cloudpss/ieslab/DataManageModel.py +2 -1
- cloudpss/ieslab/IESLabOpt.py +235 -234
- cloudpss/job/job.py +5 -3
- cloudpss/job/messageStreamReceiver.py +54 -17
- cloudpss/job/messageStreamSender.py +5 -5
- cloudpss/job/result/EMTResult.py +52 -2
- cloudpss/job/result/IESLabTypicalDayResult.py +101 -18
- cloudpss/job/result/IESResult.py +5 -3
- cloudpss/job/result/__init__.py +2 -2
- cloudpss/job/result/result.py +1 -1
- cloudpss/model/implements/diagram.py +3 -1
- cloudpss/model/model.py +10 -15
- cloudpss/runner/IESLabTypicalDayResult.py +2 -1
- cloudpss/runner/result.py +0 -1
- cloudpss/runner/runner.py +15 -2
- cloudpss/utils/httprequests.py +2 -1
- cloudpss/version.py +1 -1
- {cloudpss-4.5.12.dist-info → cloudpss-4.5.14.dist-info}/METADATA +1 -1
- {cloudpss-4.5.12.dist-info → cloudpss-4.5.14.dist-info}/RECORD +22 -22
- {cloudpss-4.5.12.dist-info → cloudpss-4.5.14.dist-info}/WHEEL +0 -0
- {cloudpss-4.5.12.dist-info → cloudpss-4.5.14.dist-info}/top_level.txt +0 -0
cloudpss/__init__.py
CHANGED
@@ -9,10 +9,11 @@ from . import function
|
|
9
9
|
from .job import Job
|
10
10
|
from .function import FunctionExecution
|
11
11
|
from .version import __version__
|
12
|
+
from .dslab import DSLab
|
12
13
|
__all__ = [
|
13
14
|
'setToken', 'Model', 'ModelRevision', 'ModelTopology', 'Runner', 'Result',
|
14
15
|
'PowerFlowResult', 'EMTResult', 'MatlabDataEncoder', 'DateTimeEncode',
|
15
|
-
'function', 'Project', 'currentJob', 'IESLabSimulation', 'IESLabPlan','IESLabOpt','__version__','Job'
|
16
|
+
'function', 'Project', 'currentJob', 'IESLabSimulation', 'IESLabPlan','IESLabOpt','__version__','Job','DSLab'
|
16
17
|
]
|
17
18
|
|
18
19
|
|
@@ -125,7 +125,6 @@ class DataManageModel(object):
|
|
125
125
|
assert (dataType in self._kindNameMap
|
126
126
|
or dataType in self._kindUrlMap), "数据类型不存在"
|
127
127
|
kind = self._kindNameMap.get(dataType, dataType)
|
128
|
-
print(kind)
|
129
128
|
return copy.deepcopy(self._kindItemDataMap[kind])
|
130
129
|
|
131
130
|
def AddDataItem(self, dataType, data):
|
@@ -496,6 +495,7 @@ class IESOptDataManageModel(DataManageModel):
|
|
496
495
|
"储氨罐": "AmmoniaStoTank",
|
497
496
|
"制氮设备": "NitrogenProduction",
|
498
497
|
"氨负荷": "ammoniaLoad",
|
498
|
+
"氨": "Ammonia",
|
499
499
|
}
|
500
500
|
_kindUrlMap = {
|
501
501
|
"PhotovoltaicSys": "api/ieslab-opt/rest/dpcs/",
|
@@ -546,5 +546,6 @@ class IESOptDataManageModel(DataManageModel):
|
|
546
546
|
"AmmoniaStoTank": "api/ieslab-opt/rest/escs/",
|
547
547
|
"NitrogenProduction": "api/ieslab-opt/rest/asec/",
|
548
548
|
"ammoniaLoad": "api/ieslab-opt/rest/ammoniaLoad/",
|
549
|
+
"Ammonia": "api/ieslab-opt/rest/ammonia/",
|
549
550
|
}
|
550
551
|
pass
|
cloudpss/ieslab/IESLabOpt.py
CHANGED
@@ -1,235 +1,236 @@
|
|
1
|
-
import json
|
2
|
-
|
3
|
-
from cloudpss.ieslab.DataManageModel import IESOptDataManageModel
|
4
|
-
from cloudpss.ieslab.EvaluationModel import IESLabOptEvaluationModel
|
5
|
-
from cloudpss.ieslab.PlanModel import IESLabOptModel
|
6
|
-
from cloudpss.runner.IESLabTypicalDayResult import IESLabTypicalDayResult
|
7
|
-
from ..utils import request
|
8
|
-
from ..model.model import Model
|
9
|
-
from cloudpss.runner.runner import Runner
|
10
|
-
from cloudpss.runner.IESLabPlanResult import IESLabOptResult
|
11
|
-
from cloudpss.runner.IESLabEvaluationResult import IESLabOptEvaluationResult
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
self.
|
20
|
-
self.
|
21
|
-
self.
|
22
|
-
self.
|
23
|
-
self.
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
self.
|
28
|
-
self.
|
29
|
-
self.
|
30
|
-
self.
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
:params
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
:params
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
:param
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
:params
|
152
|
-
:params
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
'
|
164
|
-
'
|
165
|
-
'
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
:params
|
181
|
-
:
|
182
|
-
:param
|
183
|
-
:param
|
184
|
-
:
|
185
|
-
:params
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
'
|
200
|
-
'
|
201
|
-
'
|
202
|
-
'
|
203
|
-
'
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
'
|
209
|
-
'
|
210
|
-
'
|
211
|
-
'
|
212
|
-
'
|
213
|
-
'
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
1
|
+
import json
|
2
|
+
|
3
|
+
from cloudpss.ieslab.DataManageModel import IESOptDataManageModel
|
4
|
+
from cloudpss.ieslab.EvaluationModel import IESLabOptEvaluationModel
|
5
|
+
from cloudpss.ieslab.PlanModel import IESLabOptModel
|
6
|
+
# from cloudpss.runner.IESLabTypicalDayResult import IESLabTypicalDayResult
|
7
|
+
from ..utils import request
|
8
|
+
from ..model.model import Model
|
9
|
+
from cloudpss.runner.runner import Runner
|
10
|
+
from cloudpss.runner.IESLabPlanResult import IESLabOptResult
|
11
|
+
from cloudpss.runner.IESLabEvaluationResult import IESLabOptEvaluationResult
|
12
|
+
from cloudpss.job.result.IESLabTypicalDayResult import IESLabTypicalDayResult
|
13
|
+
|
14
|
+
class IESLabOpt(object):
|
15
|
+
def __init__(self, project={}):
|
16
|
+
'''
|
17
|
+
初始化
|
18
|
+
'''
|
19
|
+
self.id = project.get('id', None)
|
20
|
+
self.name = project.get('name', None)
|
21
|
+
self.__modelRid = project.get('model', None)
|
22
|
+
self.project_group = project.get('project_group', None)
|
23
|
+
self.start_date = project.get('start_date', None)
|
24
|
+
self.end_date = project.get('end_date', None)
|
25
|
+
if self.__modelRid is not None:
|
26
|
+
self.model = Model.fetch(self.__modelRid)
|
27
|
+
self.dataManageModel = IESOptDataManageModel(self.id)
|
28
|
+
self.planModel = IESLabOptModel(self.id, self.model.rid)
|
29
|
+
self.evaluationModel = IESLabOptEvaluationModel(self.id)
|
30
|
+
self.currentPlanResult = IESLabOptResult(self.id)
|
31
|
+
self.currentEvaluationResult = IESLabOptEvaluationResult(self.id)
|
32
|
+
|
33
|
+
@staticmethod
|
34
|
+
def fetch(simulationId):
|
35
|
+
'''
|
36
|
+
获取算例信息
|
37
|
+
|
38
|
+
:params: simulationId string类型,代表数据项的算例id
|
39
|
+
|
40
|
+
:return: IESLabOpt
|
41
|
+
'''
|
42
|
+
try:
|
43
|
+
r = request('GET',
|
44
|
+
'api/ieslab-opt/rest/simu/{0}/'.format(simulationId))
|
45
|
+
project = json.loads(r.text)
|
46
|
+
return IESLabOpt(project)
|
47
|
+
except:
|
48
|
+
raise Exception('未查询到当前算例')
|
49
|
+
|
50
|
+
def __run(self, job=None, name=None):
|
51
|
+
'''
|
52
|
+
调用仿真
|
53
|
+
|
54
|
+
:params job: 调用仿真时使用的计算方案,不指定将使用算例保存时选中的计算方案
|
55
|
+
:params name: 任务名称,为空时使用项目的参数方案名称和计算方案名称
|
56
|
+
|
57
|
+
:return: 返回一个运行实例
|
58
|
+
'''
|
59
|
+
if job is None:
|
60
|
+
currentJob = self.model.context['currentJob']
|
61
|
+
job = self.model.jobs[currentJob]
|
62
|
+
job['args']['simulationId'] = self.id
|
63
|
+
return self.model.run(job, name=name)
|
64
|
+
|
65
|
+
def iesLabTypicalDayRun(self, job=None, name=None, **kwargs)-> Runner[IESLabTypicalDayResult]:
|
66
|
+
'''
|
67
|
+
运行典型日计算
|
68
|
+
|
69
|
+
:params job: 调用仿真时使用的计算方案,不指定将使用算例保存时选中的计算方案
|
70
|
+
:params name: 任务名称,为空时使用项目的参数方案名称和计算方案名称
|
71
|
+
|
72
|
+
:return: Runner[IESLabTypicalDayResult]
|
73
|
+
'''
|
74
|
+
if job is None:
|
75
|
+
currentJob = self.model.context['currentJob']
|
76
|
+
job = self.model.jobs[currentJob]
|
77
|
+
if job['rid'] != 'function/CloudPSS/ieslab-gmm-opt':
|
78
|
+
for j in self.model.jobs:
|
79
|
+
if j['rid'] == 'job-definition/ies/ies-gmm-opt' or j['rid'] == 'job-definition/cloudpss/ieslab-gmm-opt':
|
80
|
+
j['rid'] = 'function/CloudPSS/ieslab-gmm-opt'
|
81
|
+
job = j
|
82
|
+
if job is None:
|
83
|
+
raise Exception("找不到默认的综合能源系统规划典型日生成算法的计算方案")
|
84
|
+
if job['rid'] != 'function/CloudPSS/ieslab-gmm-opt':
|
85
|
+
raise Exception("不是综合能源系统规划典型日生成算法的计算方案")
|
86
|
+
return self.__run(job=job, name=name)
|
87
|
+
|
88
|
+
def iesLabEvaluationRun(self, planId, type=None):
|
89
|
+
'''
|
90
|
+
运行方案评估
|
91
|
+
|
92
|
+
:param planID int类型,表示优化方案的ID,数值位于0~优化方案数量之间
|
93
|
+
:param type string类型,表示评估类型,可选值为:能效评价、环保评价
|
94
|
+
|
95
|
+
:return: 方案评估运行实例
|
96
|
+
|
97
|
+
'''
|
98
|
+
return self.evaluationModel.run(planId, type)
|
99
|
+
|
100
|
+
def iesLabEnergyEvaluationRun(self, planId):
|
101
|
+
'''
|
102
|
+
运行能效评价
|
103
|
+
|
104
|
+
:param planID int类型,表示优化方案的ID,数值位于0~优化方案数量之间
|
105
|
+
|
106
|
+
:return: 能效评价运行实例
|
107
|
+
|
108
|
+
'''
|
109
|
+
return self.evaluationModel.EnergyEvaluationRun(planId)
|
110
|
+
|
111
|
+
def iesLabEnvironmentalEvaluationRun(self, planId):
|
112
|
+
'''
|
113
|
+
运行环保评价
|
114
|
+
|
115
|
+
:param planID int类型,表示优化方案的ID,数值位于0~优化方案数量之间
|
116
|
+
|
117
|
+
:return: 环保评价运行实例
|
118
|
+
'''
|
119
|
+
return self.evaluationModel.EnvironmentalEvaluationRun(planId)
|
120
|
+
|
121
|
+
def iesLabOptRun(self):
|
122
|
+
'''
|
123
|
+
生成方案优选算例
|
124
|
+
|
125
|
+
:return: 方案优选运行实例
|
126
|
+
'''
|
127
|
+
return self.planModel.run()
|
128
|
+
|
129
|
+
def iesLabOptKill(self):
|
130
|
+
'''
|
131
|
+
停止并删除方案优选算例
|
132
|
+
|
133
|
+
:return: Boolean
|
134
|
+
'''
|
135
|
+
return self.planModel.kill()
|
136
|
+
|
137
|
+
def createProjectGroup(self, name):
|
138
|
+
'''
|
139
|
+
创建项目组
|
140
|
+
|
141
|
+
:params name: 项目组名称
|
142
|
+
|
143
|
+
:return: 返回一个创建的项目组
|
144
|
+
'''
|
145
|
+
|
146
|
+
@staticmethod
|
147
|
+
def createProjectGroup(group_name, desc=None, createById=None):
|
148
|
+
'''
|
149
|
+
创建项目组
|
150
|
+
|
151
|
+
:params group_name: String 项目组名称
|
152
|
+
:params desc: String 项目组描述 可选参数
|
153
|
+
:params createById Int 父项目组id 可选参数,如果是从已有项目组导入的项目组,必填此项
|
154
|
+
|
155
|
+
:return: Int 返回创建的项目组id
|
156
|
+
'''
|
157
|
+
try:
|
158
|
+
if createById is None:
|
159
|
+
isImport = 0
|
160
|
+
else:
|
161
|
+
isImport = 1
|
162
|
+
payload = {
|
163
|
+
'group_name': group_name,
|
164
|
+
'desc': desc,
|
165
|
+
'isImport': isImport,
|
166
|
+
'createById': createById,
|
167
|
+
}
|
168
|
+
r = request(
|
169
|
+
'POST', 'api/ieslab-opt/rest/projectgroup/', data=json.dumps(payload))
|
170
|
+
project = json.loads(r.text)
|
171
|
+
return project.get('id', None)
|
172
|
+
except Exception as e:
|
173
|
+
raise Exception('创建项目组失败')
|
174
|
+
|
175
|
+
@staticmethod
|
176
|
+
def createProject(name, project_group, start_date, end_date, construction_cycle, desc=None, createById=None):
|
177
|
+
'''
|
178
|
+
创建项目
|
179
|
+
|
180
|
+
:params name: String 项目名称
|
181
|
+
:params project_group: Int 父项目组id
|
182
|
+
:param start_date: Int 项目开始年限,范围在[1500,3000]之间
|
183
|
+
:param end_date: Int 项目结束年限,范围在项目开始时间之后且不超过五十年
|
184
|
+
:param construction_cycle: Int 项目建设周期(年), 必须小于等于 项目结束年限 - 项目开始年限
|
185
|
+
:params desc: String 项目描述, 可选参数
|
186
|
+
:params createById Int 父项目id, 可选参数, 如果是从已有项目导入的项目,必填此项
|
187
|
+
|
188
|
+
:return: Int 返回创建的项目id
|
189
|
+
'''
|
190
|
+
try:
|
191
|
+
if start_date < 1500 or start_date > 3000:
|
192
|
+
raise Exception('项目开始年限错误,范围在[1500,3000]之间')
|
193
|
+
if end_date < start_date or end_date > start_date + 50:
|
194
|
+
raise Exception('项目结束年限错误,范围在项目开始时间之后且不超过五十年')
|
195
|
+
if construction_cycle > end_date - start_date:
|
196
|
+
raise Exception('项目建设周期错误,必须小于等于 项目结束年限 - 项目开始年限')
|
197
|
+
if createById is None:
|
198
|
+
payload = {
|
199
|
+
'name': name,
|
200
|
+
'project_group': project_group,
|
201
|
+
'start_date': start_date,
|
202
|
+
'end_date': end_date,
|
203
|
+
'construction_cycle': construction_cycle,
|
204
|
+
'desc': desc
|
205
|
+
}
|
206
|
+
else:
|
207
|
+
payload = {
|
208
|
+
'name': name,
|
209
|
+
'project_group': project_group,
|
210
|
+
'start_date': start_date,
|
211
|
+
'end_date': end_date,
|
212
|
+
'construction_cycle': construction_cycle,
|
213
|
+
'desc': desc,
|
214
|
+
'createById': createById
|
215
|
+
}
|
216
|
+
r = request(
|
217
|
+
'POST', 'api/ieslab-opt/rest/simu/', data=json.dumps(payload))
|
218
|
+
project = json.loads(r.text)
|
219
|
+
return project.get('id', None)
|
220
|
+
except Exception as e:
|
221
|
+
raise Exception('创建项目失败')
|
222
|
+
|
223
|
+
|
224
|
+
@staticmethod
|
225
|
+
def getProjectList():
|
226
|
+
'''
|
227
|
+
获取项目组列表
|
228
|
+
|
229
|
+
:return: 返回项目组列表
|
230
|
+
'''
|
231
|
+
try:
|
232
|
+
r = request('GET', 'api/ieslab-opt/rest/projectgroup/?mode=simu')
|
233
|
+
project = json.loads(r.text)
|
234
|
+
return project
|
235
|
+
except Exception as e:
|
235
236
|
raise Exception('获取项目组列表失败')
|
cloudpss/job/job.py
CHANGED
@@ -202,7 +202,7 @@ class Job(Generic[T]):
|
|
202
202
|
if receiver is not None:
|
203
203
|
self.__receiver = receiver
|
204
204
|
if self.__receiver is None:
|
205
|
-
self.__receiver = MessageStreamReceiver(self)
|
205
|
+
self.__receiver = MessageStreamReceiver(self.output)
|
206
206
|
self.__receiver.connect(**kwargs)
|
207
207
|
return self.__receiver
|
208
208
|
|
@@ -216,7 +216,7 @@ class Job(Generic[T]):
|
|
216
216
|
if sender is not None:
|
217
217
|
self.__sender = sender
|
218
218
|
if self.__sender is None:
|
219
|
-
self.__sender = MessageStreamSender(self)
|
219
|
+
self.__sender = MessageStreamSender(self.input)
|
220
220
|
self.__sender.connect_legacy(**kwargs)
|
221
221
|
return self.__sender
|
222
222
|
|
@@ -259,7 +259,9 @@ class Job(Generic[T]):
|
|
259
259
|
sender = self.write()
|
260
260
|
if resultType is None:
|
261
261
|
resultType = getResultClass(self.context[0])
|
262
|
-
|
262
|
+
self._result= resultType(receiver, sender)
|
263
|
+
|
264
|
+
return self._result
|
263
265
|
|
264
266
|
|
265
267
|
|
@@ -1,5 +1,9 @@
|
|
1
|
+
import datetime
|
1
2
|
import logging
|
2
3
|
import sys
|
4
|
+
|
5
|
+
from cloudpss.job.TemplateManager import TemplateManager
|
6
|
+
|
3
7
|
from .jobReceiver import JobReceiver
|
4
8
|
import os
|
5
9
|
from urllib.parse import urlparse
|
@@ -7,7 +11,6 @@ import websocket
|
|
7
11
|
import pytz
|
8
12
|
import threading
|
9
13
|
import time
|
10
|
-
|
11
14
|
utc_tz = pytz.timezone("UTC")
|
12
15
|
|
13
16
|
from ..utils.IO import IO
|
@@ -18,15 +21,31 @@ class Message(object):
|
|
18
21
|
self.id = id
|
19
22
|
self.token = token
|
20
23
|
|
21
|
-
|
24
|
+
|
25
|
+
|
22
26
|
class MessageStreamReceiver(JobReceiver):
|
23
|
-
def __init__(self,
|
27
|
+
def __init__(self, output):
|
24
28
|
super().__init__()
|
25
|
-
self.
|
26
|
-
self.id =self.job.output
|
29
|
+
self.id = output
|
27
30
|
self.origin = os.environ.get("CLOUDPSS_API_URL", "https://cloudpss.net/")
|
28
31
|
self.__hasOpen = False
|
29
|
-
|
32
|
+
self.templates=TemplateManager()
|
33
|
+
self.timeOffset=0
|
34
|
+
self.lastMessageTime=0
|
35
|
+
|
36
|
+
|
37
|
+
def updateTime(self,timestamp):
|
38
|
+
self.lastMessageTime = timestamp
|
39
|
+
|
40
|
+
## 判断是否到达当前时间点的数据或者消息流结束
|
41
|
+
def isEnd(self,current_time=None):
|
42
|
+
|
43
|
+
if self.status == 1:
|
44
|
+
return True
|
45
|
+
logging.debug('lastMessageTime',self.lastMessageTime)
|
46
|
+
current_time = current_time if current_time is not None else time.time()
|
47
|
+
return (self.lastMessageTime/1000)>=current_time-self.timeOffset
|
48
|
+
|
30
49
|
def __path(self, from_=None):
|
31
50
|
if self.id is None:
|
32
51
|
raise Exception("id is None")
|
@@ -39,22 +58,36 @@ class MessageStreamReceiver(JobReceiver):
|
|
39
58
|
|
40
59
|
###下面是兼容Receiver部分功能实现
|
41
60
|
def __on_message_legacy(self, *args, **kwargs):
|
42
|
-
|
43
61
|
if type(args[0]) != websocket.WebSocketApp:
|
44
62
|
message = args[0]
|
45
63
|
else:
|
46
64
|
message = args[1]
|
47
65
|
return self.__on_message(message)
|
48
|
-
|
49
66
|
def __on_message(self, message):
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
67
|
+
try:
|
68
|
+
data = IO.deserialize(message, "ubjson")
|
69
|
+
self.updateTime(data["timestamp"])
|
70
|
+
self.ws.url = self.__path(data["id"])
|
71
|
+
msg = IO.deserialize(data["data"], "ubjson")
|
72
|
+
if type(msg) is list:
|
73
|
+
if len(msg) == 3:
|
74
|
+
pass
|
75
|
+
|
76
|
+
templateMessage = self.templates.invoke(msg)
|
77
|
+
# print(templateMessage)
|
78
|
+
for m in templateMessage:
|
79
|
+
self.messages.append(m)
|
80
|
+
return
|
81
|
+
else:
|
82
|
+
self.templates.create(msg)
|
83
|
+
return
|
84
|
+
|
85
|
+
self.messages.append(msg)
|
86
|
+
return msg
|
87
|
+
except Exception as e:
|
88
|
+
print(msg)
|
89
|
+
self.ws.close()
|
90
|
+
return None
|
58
91
|
|
59
92
|
|
60
93
|
def __on_error(self, *args, **kwargs):
|
@@ -101,6 +134,10 @@ class MessageStreamReceiver(JobReceiver):
|
|
101
134
|
|
102
135
|
def __on_open(self,ws, *args, **kwargs):
|
103
136
|
self.ws = ws
|
137
|
+
gmt_format = '%a, %d %b %Y %H:%M:%S GMT'
|
138
|
+
serverTime = datetime.datetime.strptime(ws.sock.headers['date'],gmt_format)
|
139
|
+
self.timeOffset = time.time()+time.timezone-serverTime.timestamp()
|
140
|
+
|
104
141
|
logging.debug(f"MessageStreamReceiver on_open")
|
105
142
|
self._status = 0
|
106
143
|
self.__hasOpen = True
|
@@ -128,7 +165,7 @@ class MessageStreamReceiver(JobReceiver):
|
|
128
165
|
|
129
166
|
|
130
167
|
def connect(self):
|
131
|
-
self._status =
|
168
|
+
self._status = 0
|
132
169
|
path = self.__path()
|
133
170
|
logging.info(f"receive data from websocket: {path}")
|
134
171
|
self.ws = websocket.WebSocketApp(
|
@@ -12,9 +12,9 @@ import logging
|
|
12
12
|
|
13
13
|
|
14
14
|
class MessageStreamSender:
|
15
|
-
def __init__(self,
|
15
|
+
def __init__(self, input):
|
16
16
|
super().__init__()
|
17
|
-
self.
|
17
|
+
self.input = input
|
18
18
|
self.origin = os.environ.get("CLOUDPSS_API_URL", "https://cloudpss.net/")
|
19
19
|
self.__hasOpen = False
|
20
20
|
|
@@ -60,14 +60,14 @@ class MessageStreamSender:
|
|
60
60
|
同步方法连接ws
|
61
61
|
"""
|
62
62
|
self._status = 0
|
63
|
-
if self.
|
63
|
+
if self.input is None:
|
64
64
|
raise Exception("id is None")
|
65
|
-
if self.
|
65
|
+
if self.input == "00000000-0000-0000-0000-000000000000":
|
66
66
|
return
|
67
67
|
u = list(urlparse(self.origin))
|
68
68
|
head = "wss" if u[0] == "https" else "ws"
|
69
69
|
|
70
|
-
path = head + "://" + str(u[1]) + "/api/streams/token/" + self.
|
70
|
+
path = head + "://" + str(u[1]) + "/api/streams/token/" + self.input
|
71
71
|
logging.debug(f"MessageStreamSender data from websocket: {path}")
|
72
72
|
|
73
73
|
self.ws = websocket.WebSocketApp(
|
cloudpss/job/result/EMTResult.py
CHANGED
@@ -2,6 +2,33 @@ import copy
|
|
2
2
|
import uuid
|
3
3
|
from deprecated import deprecated
|
4
4
|
from .result import Result
|
5
|
+
|
6
|
+
|
7
|
+
class VirtualInput:
|
8
|
+
"""
|
9
|
+
虚拟输入类,用于仿真结果的输入
|
10
|
+
|
11
|
+
该类只提供 EMT 仿真使用
|
12
|
+
"""
|
13
|
+
|
14
|
+
def __init__(self,**kwargs):
|
15
|
+
self.args=kwargs
|
16
|
+
|
17
|
+
def toJson(self):
|
18
|
+
"""
|
19
|
+
转换为 json 数据
|
20
|
+
"""
|
21
|
+
return {
|
22
|
+
"type": 'virtual_input',
|
23
|
+
"data": self.args,
|
24
|
+
}
|
25
|
+
|
26
|
+
def update(self,**kwargs):
|
27
|
+
"""
|
28
|
+
更新输入参数
|
29
|
+
"""
|
30
|
+
for key,value in kwargs.items():
|
31
|
+
self.args[key]=value
|
5
32
|
class EMTResult(Result):
|
6
33
|
"""
|
7
34
|
电磁暂态结果视图,
|
@@ -11,7 +38,12 @@ class EMTResult(Result):
|
|
11
38
|
该类只提供 EMT 仿真使用
|
12
39
|
|
13
40
|
"""
|
14
|
-
|
41
|
+
|
42
|
+
def __init__(self, receiver, sender = None):
|
43
|
+
super().__init__(receiver, sender)
|
44
|
+
self.virtualInput=VirtualInput()
|
45
|
+
|
46
|
+
__messageIndex = 0
|
15
47
|
def getPlots(self):
|
16
48
|
'''
|
17
49
|
获取所有的 plots 数据
|
@@ -19,7 +51,9 @@ class EMTResult(Result):
|
|
19
51
|
>>> result.getPlots()
|
20
52
|
{...}
|
21
53
|
'''
|
22
|
-
|
54
|
+
maxLength = len(self._receiver.messages)
|
55
|
+
for i in range(self.__messageIndex,maxLength):
|
56
|
+
val = self._receiver.messages[i]
|
23
57
|
if val['type'] == 'plot':
|
24
58
|
key = val['key']
|
25
59
|
if self.result.get(key, None) is None:
|
@@ -32,6 +66,7 @@ class EMTResult(Result):
|
|
32
66
|
v['x'])
|
33
67
|
self.result[key]['data']['traces'][i]['y'].extend(
|
34
68
|
v['y'])
|
69
|
+
self.__messageIndex = maxLength
|
35
70
|
return self.result.values()
|
36
71
|
|
37
72
|
def getPlot(self, index: int):
|
@@ -109,6 +144,21 @@ class EMTResult(Result):
|
|
109
144
|
self._sender.write({'type': 'memory', 'path': path,'buffer':buffer,'offset':offset})
|
110
145
|
else:
|
111
146
|
raise Exception('transmitter is None')
|
147
|
+
|
148
|
+
def send(self,message):
|
149
|
+
"""
|
150
|
+
发送消息
|
151
|
+
"""
|
152
|
+
if self._sender is not None:
|
153
|
+
val =message
|
154
|
+
if type(message) is VirtualInput:
|
155
|
+
val = message.toJson()
|
156
|
+
|
157
|
+
self._sender.write(val)
|
158
|
+
else:
|
159
|
+
raise Exception('transmitter is None')
|
160
|
+
|
161
|
+
|
112
162
|
|
113
163
|
def _writeEvent(self,eventType,eventTime,eventTimeType,defaultApp):
|
114
164
|
if self._sender is None:
|
@@ -1,6 +1,44 @@
|
|
1
1
|
from .IESResult import IESResult
|
2
2
|
import re
|
3
3
|
import copy
|
4
|
+
from cloudpss.job.messageStreamReceiver import MessageStreamReceiver, Message
|
5
|
+
import asyncio
|
6
|
+
from concurrent.futures import ThreadPoolExecutor
|
7
|
+
import threading
|
8
|
+
import time
|
9
|
+
from queue import Queue
|
10
|
+
|
11
|
+
class IESLabTypicalDaySubMessageResult():
|
12
|
+
def __init__(self, output) -> None:
|
13
|
+
self.receiver = MessageStreamReceiver(output)
|
14
|
+
# self.result={}
|
15
|
+
|
16
|
+
def connect(self):
|
17
|
+
self.receiver.connect()
|
18
|
+
|
19
|
+
def status(self):
|
20
|
+
return self.receiver.status()
|
21
|
+
|
22
|
+
def wait(self,timeout=10,current_time=None):
|
23
|
+
start = time.time()
|
24
|
+
while True:
|
25
|
+
time.sleep(0.1)
|
26
|
+
if self.receiver.isEnd(current_time):
|
27
|
+
break
|
28
|
+
if time.time()-start>timeout:
|
29
|
+
break
|
30
|
+
# raise Exception("获取数据超时")
|
31
|
+
|
32
|
+
def getMessages(self,timeout=10,current_time=None):
|
33
|
+
result={}
|
34
|
+
self.wait(timeout,current_time)
|
35
|
+
|
36
|
+
for val in self.receiver:
|
37
|
+
if val.get('type',None) !='plot':
|
38
|
+
continue
|
39
|
+
result[val['key']] = val['data']
|
40
|
+
return result
|
41
|
+
|
4
42
|
class IESLabTypicalDayResult(IESResult):
|
5
43
|
|
6
44
|
def __init__(self, *args, **kwargs):
|
@@ -12,27 +50,36 @@ class IESLabTypicalDayResult(IESResult):
|
|
12
50
|
self.__typicalIndex = 0
|
13
51
|
self.__type_list =['总辐射','散射辐射', '直射辐射','天顶角', '环境温度', '湿球温度','土壤温度', '10m风速', '50m风速','电负荷', '热负荷','冷负荷','氢负荷']
|
14
52
|
self.__map_load = { 'maxElectricalLoad':'电负荷', 'maxHeatLoad':'热负荷','maxCoolLoad':'冷负荷','maxHydrogenLoad':'氢负荷' }
|
53
|
+
self.token = ''
|
15
54
|
|
16
55
|
self.result = {'TypicalMonth': [{'月份': int,'持续天数': [],**{key: [] for key in self.__type_list}} for i in range(12)],'TypicalDay': []}
|
56
|
+
self.messagemap={}
|
57
|
+
|
17
58
|
def __readPlotResult(self):
|
59
|
+
|
18
60
|
length = self.getMessageLength()
|
61
|
+
|
62
|
+
print(length)
|
19
63
|
if (length > self.__plotIndex):
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
64
|
+
|
65
|
+
|
66
|
+
# stream_id = "fce32578-75c2-4aca-8323-1ce60941e57b"
|
67
|
+
|
68
|
+
# if val['type'] == 'plot':# 每个月各类型数据的各个典型日的数据,由于部分月份可能没有电冷热负荷,某月的某个典型日可能缺少冷热负荷
|
69
|
+
# key_re = re.split('-month',val['key'])#格式为:散射辐射-month1,re后分别为类型和月份
|
70
|
+
# typical_month_m = self.result['TypicalMonth'][int(key_re[1])-1]
|
71
|
+
# typical_month_m['月份'] = int(key_re[1])
|
72
|
+
# val_data_traces = val['data']['traces']
|
73
|
+
# #val['data']['traces'][i]['name']格式为:典型日1-共31天,re正则后[0]为典型日顺序,[1]为持续天数
|
74
|
+
# typicalNum = int(re.findall('\d+',val_data_traces[-1]['name'])[0])
|
75
|
+
# for i in range(typicalNum):#取该类型的最后一个典型日顺序,当该类型缺少后排典型日时,小于实际典型日数量
|
76
|
+
# typical_month_m[key_re[0]].append([])
|
77
|
+
# if key_re[0] == '环境温度':#各类版本气象数据均有环境温度数据,其典型日数量为实际数量
|
78
|
+
# typical_month_m['持续天数'].append(int(re.findall('\d+',val_data_traces[i]['name'])[1]))
|
79
|
+
# # 当前排典型日缺少数据时,该类型数据为空list[];当后排典型日缺少数据时,该类型数据为空
|
80
|
+
# for i in range(len(val_data_traces)):
|
81
|
+
# typical_month_m[key_re[0]][int(re.findall('\d+',val_data_traces[i]['name'])[0])-1] = copy.deepcopy(val_data_traces[i]['y'])
|
82
|
+
|
36
83
|
self.__plotIndex = length
|
37
84
|
# update TypicalDay based on TypicalMonth
|
38
85
|
for m in range(12):
|
@@ -54,6 +101,36 @@ class IESLabTypicalDayResult(IESResult):
|
|
54
101
|
if typical_month_m[type_i] and i < len(typical_month_m[type_i]):
|
55
102
|
typical_day_index['data'][type_i] = typical_month_m[type_i][i]
|
56
103
|
self.__typicalIndex += 1
|
104
|
+
def __init_message_map(self):
|
105
|
+
|
106
|
+
message = self.getMessagesByKey("message_map")
|
107
|
+
if message is None or len(message) == 0:
|
108
|
+
return
|
109
|
+
|
110
|
+
self.messagemap = {}
|
111
|
+
for m in message:
|
112
|
+
dataMap = m['data']['map']
|
113
|
+
for item in dataMap:
|
114
|
+
messages = item['messages']
|
115
|
+
for val in messages:
|
116
|
+
self.messagemap[val] = item['id']
|
117
|
+
|
118
|
+
def __init_result(self):
|
119
|
+
self.__init_message_map()
|
120
|
+
# print(self.messagemap)
|
121
|
+
current_time = time.time()
|
122
|
+
|
123
|
+
for key,val in self.messagemap.items():
|
124
|
+
|
125
|
+
sub=IESLabTypicalDaySubMessageResult(val)
|
126
|
+
sub.connect()
|
127
|
+
message = sub.getMessages(current_time=current_time,timeout=10)
|
128
|
+
print("key",key,'message', message)
|
129
|
+
|
130
|
+
|
131
|
+
pass
|
132
|
+
|
133
|
+
|
57
134
|
def GetTypical(self):
|
58
135
|
'''
|
59
136
|
获取所有的 GetTypical 典型日数据
|
@@ -61,7 +138,7 @@ class IESLabTypicalDayResult(IESResult):
|
|
61
138
|
>>> result.GetTypical()
|
62
139
|
{...}
|
63
140
|
'''
|
64
|
-
self.
|
141
|
+
self.__init_result()
|
65
142
|
return self.result['TypicalDay']
|
66
143
|
def GetTypicalDayNum(self):
|
67
144
|
'''
|
@@ -131,4 +208,10 @@ class IESLabTypicalDayResult(IESResult):
|
|
131
208
|
:return: list<list>类型,代表以1h为时间间隔的该参数的典型日内时序曲线
|
132
209
|
'''
|
133
210
|
self.__readPlotResult()
|
134
|
-
return self.result['TypicalMonth'][monthID-1].get(dataType,'没有该类型数据')
|
211
|
+
return self.result['TypicalMonth'][monthID-1].get(dataType,'没有该类型数据')
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
cloudpss/job/result/IESResult.py
CHANGED
@@ -13,7 +13,7 @@ class IESResult(Result):
|
|
13
13
|
|
14
14
|
"""
|
15
15
|
|
16
|
-
|
16
|
+
__messageIndex = 0
|
17
17
|
def __init__(self,receiver,sender) -> None:
|
18
18
|
super().__init__(receiver,sender)
|
19
19
|
self.result = {'Sankey': []}
|
@@ -21,7 +21,9 @@ class IESResult(Result):
|
|
21
21
|
|
22
22
|
|
23
23
|
def __readPlotResult(self):
|
24
|
-
|
24
|
+
maxLength = len(self._receiver.messages)
|
25
|
+
for i in range(self.__messageIndex,maxLength):
|
26
|
+
val = self._receiver.messages[i]
|
25
27
|
if val['type'] == 'plot':
|
26
28
|
key = val['key']
|
27
29
|
if key == 'Sankey':
|
@@ -37,7 +39,7 @@ class IESResult(Result):
|
|
37
39
|
'x'].extend(v['x'])
|
38
40
|
self.result[key]['data']['traces'][i][
|
39
41
|
'y'].extend(v['y'])
|
40
|
-
|
42
|
+
self.__messageIndex = maxLength
|
41
43
|
def getPlotData(self, compID, labelName, traceName='all', index=-1):
|
42
44
|
'''
|
43
45
|
获取元件ID为compID的元件,对应标签为labelName、图例名称为traceName的plot 数据的第index项
|
cloudpss/job/result/__init__.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
from .IESResult import IESResult
|
2
2
|
from .result import Result
|
3
|
-
from .EMTResult import EMTResult
|
3
|
+
from .EMTResult import EMTResult,VirtualInput
|
4
4
|
from .PowerFlowResult import PowerFlowResult
|
5
5
|
from .IESLabSimulationResult import IESLabSimulationResult
|
6
6
|
from .IESLabTypicalDayResult import IESLabTypicalDayResult
|
7
7
|
from ..messageStreamReceiver import MessageStreamReceiver
|
8
8
|
from ..messageStreamSender import MessageStreamSender
|
9
9
|
__all__ = [
|
10
|
-
'Result','EMTResult','PowerFlowResult','IESLabSimulationResult','IESResult','IESLabTypicalDayResult','MessageStreamReceiver','MessageStreamSender'
|
10
|
+
'Result','EMTResult','PowerFlowResult','IESLabSimulationResult','IESResult','IESLabTypicalDayResult','MessageStreamReceiver','MessageStreamSender',"VirtualInput"
|
11
11
|
]
|
12
12
|
|
13
13
|
RESULT = {
|
cloudpss/job/result/result.py
CHANGED
@@ -17,6 +17,7 @@ class Result(object):
|
|
17
17
|
self._receiver = receiver
|
18
18
|
self._sender = sender
|
19
19
|
self.__logsIndex = 0
|
20
|
+
|
20
21
|
|
21
22
|
async def receive(self):
|
22
23
|
async for msg in self._receiver:
|
@@ -82,7 +83,6 @@ class Result(object):
|
|
82
83
|
|
83
84
|
>>> message= db.getMessagesByType('log')
|
84
85
|
"""
|
85
|
-
|
86
86
|
result = []
|
87
87
|
for val in self._receiver:
|
88
88
|
if val['type'] == type:
|
@@ -126,8 +126,10 @@ class DiagramImplement(object):
|
|
126
126
|
component = self.cells.get(key)
|
127
127
|
if not component:
|
128
128
|
return False
|
129
|
-
position = component.position.copy()
|
130
129
|
del self.cells[key]
|
130
|
+
position=getattr(component, "position", None)
|
131
|
+
if position is None:
|
132
|
+
return True
|
131
133
|
for edge in self.cells.values():
|
132
134
|
if edge.shape == "diagram-edge":
|
133
135
|
if edge.source.get("cell") == key:
|
cloudpss/model/model.py
CHANGED
@@ -47,6 +47,11 @@ class Model(object):
|
|
47
47
|
name
|
48
48
|
rid
|
49
49
|
tags
|
50
|
+
permissions {
|
51
|
+
moderator
|
52
|
+
member
|
53
|
+
everyone
|
54
|
+
}
|
50
55
|
revision {
|
51
56
|
author
|
52
57
|
documentation
|
@@ -480,9 +485,6 @@ class Model(object):
|
|
480
485
|
elif owner[0] != username:
|
481
486
|
raise Exception("rid 错误,无法保存")
|
482
487
|
|
483
|
-
isPublic = model.context.get("auth", "") != "private"
|
484
|
-
publicRead = model.context.get("publicRead", "") != False
|
485
|
-
auth = (65539 if publicRead else 65537) if isPublic else 0
|
486
488
|
revision = ModelRevision.create(model.revision, model.revision.hash)
|
487
489
|
|
488
490
|
return graphql_request(
|
@@ -498,9 +500,9 @@ class Model(object):
|
|
498
500
|
"description": model.description,
|
499
501
|
"tags": model.tags,
|
500
502
|
"permissions": {
|
501
|
-
|
502
|
-
"member":
|
503
|
-
"everyone":
|
503
|
+
"moderator": 98367,
|
504
|
+
"member": 65551,
|
505
|
+
"everyone": 0
|
504
506
|
},
|
505
507
|
}
|
506
508
|
},
|
@@ -530,10 +532,7 @@ class Model(object):
|
|
530
532
|
raise Exception("rid 错误,无法保存")
|
531
533
|
|
532
534
|
|
533
|
-
|
534
|
-
isComponent = model.context.get("category", "") == "component"
|
535
|
-
publicRead = model.context.get("publicRead", "") != False
|
536
|
-
auth = (65539 if publicRead else 65537) if isPublic else 0
|
535
|
+
permissions=model.permissions
|
537
536
|
revision = ModelRevision.create(model.revision, model.revision.hash)
|
538
537
|
|
539
538
|
xVersion = int(float(os.environ.get('X_CLOUDPSS_VERSION', 4)))
|
@@ -554,11 +553,7 @@ class Model(object):
|
|
554
553
|
'name': model.name,
|
555
554
|
'description': model.description,
|
556
555
|
'tags': tags,
|
557
|
-
"permissions":
|
558
|
-
"moderator": 1,
|
559
|
-
"member": 1,
|
560
|
-
"everyone": auth,
|
561
|
-
},
|
556
|
+
"permissions": permissions,
|
562
557
|
}
|
563
558
|
})
|
564
559
|
if "errors" in r:
|
cloudpss/runner/result.py
CHANGED
cloudpss/runner/runner.py
CHANGED
@@ -12,10 +12,12 @@ from .MessageStreamReceiver import MessageStreamReceiver
|
|
12
12
|
from .result import IESLabSimulationResult, PowerFlowResult, EMTResult, Result, IESResult
|
13
13
|
from .IESLabPlanResult import IESLabPlanResult, IESLabOptResult
|
14
14
|
from .IESLabEvaluationResult import IESLabEvaluationResult, IESLabPlanEvaluationResult, IESLabOptEvaluationResult
|
15
|
-
from .IESLabTypicalDayResult import IESLabTypicalDayResult
|
15
|
+
# from .IESLabTypicalDayResult import IESLabTypicalDayResult
|
16
|
+
from ..job.result.IESLabTypicalDayResult import IESLabTypicalDayResult
|
16
17
|
from .storage import Storage
|
17
18
|
from ..utils import request
|
18
19
|
from typing import TypeVar, Generic
|
20
|
+
from .DSLabResult import DSLabResult
|
19
21
|
import re
|
20
22
|
|
21
23
|
RECEIVER = {
|
@@ -35,7 +37,9 @@ IES_LAB_OPT_RESULT = {
|
|
35
37
|
'function/ieslab/evaluation': IESLabOptEvaluationResult,
|
36
38
|
}
|
37
39
|
|
38
|
-
|
40
|
+
DS_LAB_RESULT = {
|
41
|
+
'function/ieslab/evaluation': DSLabResult
|
42
|
+
}
|
39
43
|
|
40
44
|
RESULT_DB = {
|
41
45
|
'function/CloudPSS/emtp': EMTResult,
|
@@ -256,6 +260,15 @@ class HttpRunner(Runner[T]):
|
|
256
260
|
return False
|
257
261
|
return self.result.status() # type: ignore
|
258
262
|
|
263
|
+
class DSLabRunner(Runner[T]):
|
264
|
+
def __init__(self, job, simulationId, **kwargs):
|
265
|
+
self.simulationId = simulationId
|
266
|
+
self.job = job
|
267
|
+
result = DS_LAB_RESULT.get(job.get('rid', ''), DSLabResult)
|
268
|
+
self.result: T = result(self.simulationId, **kwargs)
|
269
|
+
|
270
|
+
def status(self):
|
271
|
+
return self.result.status()
|
259
272
|
|
260
273
|
class HttpOPTRunner(Runner[T]):
|
261
274
|
|
cloudpss/utils/httprequests.py
CHANGED
@@ -29,7 +29,7 @@ def request(method, uri, baseUrl=None, params={}, token=None, **kwargs):
|
|
29
29
|
del kwargs['xToken']
|
30
30
|
|
31
31
|
r = requests.request(method, url, params=params, headers=headers, **kwargs)
|
32
|
-
|
32
|
+
|
33
33
|
if (uri.startswith('graphql')):
|
34
34
|
if 'X-Cloudpss-Version' not in r.headers:
|
35
35
|
raise Exception(
|
@@ -43,6 +43,7 @@ def request(method, uri, baseUrl=None, params={}, token=None, **kwargs):
|
|
43
43
|
# if r.ok:
|
44
44
|
# return r
|
45
45
|
# logging.debug(r.text)
|
46
|
+
# print(r.text)
|
46
47
|
# if r.text =="":
|
47
48
|
r.raise_for_status()
|
48
49
|
if "statusCode" in r.text:
|
cloudpss/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '4.5.
|
1
|
+
__version__ = '4.5.14'
|
@@ -1,6 +1,6 @@
|
|
1
|
-
cloudpss/__init__.py,sha256=
|
1
|
+
cloudpss/__init__.py,sha256=xnA-UjehYOzH6KV7vOXHwdbGEiw6g_OPKzrbZA9Fuc8,858
|
2
2
|
cloudpss/verify.py,sha256=KF4Gd59DGvCyIEkRD7rNnekWw22XxJpi3DW6keb6j4c,1498
|
3
|
-
cloudpss/version.py,sha256=
|
3
|
+
cloudpss/version.py,sha256=_rcYfia10t15TUgPkQvxNv7NkZu1MKRhIBYRWbJufEA,23
|
4
4
|
cloudpss/asyncio/__init__.py,sha256=CJGopQl_vz3z3fJsK7NjMX5uzkzfrJrbqKVhyYqlYWc,198
|
5
5
|
cloudpss/asyncio/job/__init__.py,sha256=3UIFZYjJTzuckM61o8kim1c3PWt2SSHTL72jrGu5IzI,51
|
6
6
|
cloudpss/asyncio/job/job.py,sha256=Bn2BEERw1J8YarFauTzVrGJK7nmaoMsdlrFUqiHRth4,3897
|
@@ -24,9 +24,9 @@ cloudpss/function/__init__.py,sha256=TNzChB-gQF6oB62F423evpUlgcp6s03D4pKKs89Lz4Q
|
|
24
24
|
cloudpss/function/function.py,sha256=llomkfnTmKMiFJYJ2mKnmAEoIjTNVCnjCUUyiJMOV1s,29
|
25
25
|
cloudpss/function/functionExecution.py,sha256=YM2hS0Ao3jhMJodqFfxk0JAK7ZR00MPh-U2foBWshT0,16897
|
26
26
|
cloudpss/function/job.py,sha256=LdzaTyjvBcMZIyLstSZnt79d2eREljx2HnNoilDp03A,13162
|
27
|
-
cloudpss/ieslab/DataManageModel.py,sha256=
|
27
|
+
cloudpss/ieslab/DataManageModel.py,sha256=k0ZLToBuIKl2Kj8LDvMUUaGc3wLE1CgZ8BmRKNDm7tk,26024
|
28
28
|
cloudpss/ieslab/EvaluationModel.py,sha256=hGZmuaB8lL9LVti_TCG-qCfK_bA-HJgdxYt7oMmVrXY,9399
|
29
|
-
cloudpss/ieslab/IESLabOpt.py,sha256=
|
29
|
+
cloudpss/ieslab/IESLabOpt.py,sha256=D2iDbi80ohvU7wKelb-Uk6FP_S0rbZyHfWwlBbQYYPc,9379
|
30
30
|
cloudpss/ieslab/IESLabPlan.py,sha256=rEf1W2pT_J3C8-TFFHVm8Llli9ySSXbBeRpd6Yz9Glk,8345
|
31
31
|
cloudpss/ieslab/IESLabSimulation.py,sha256=-EJFkhklN9ao-nbfk7Lz6JCHboFCSDcn5R2jr3_Z7_A,4046
|
32
32
|
cloudpss/ieslab/PlanModel.py,sha256=fLWzVnRiyYRHchG2xsfUH-oCUmnF1uwbDuWNC750dWw,12612
|
@@ -34,47 +34,47 @@ cloudpss/ieslab/__init__.py,sha256=gr1rXYw9vIAGOe60eg7LyMHP7QDXvNf4dJ5GTR_kj1Y,2
|
|
34
34
|
cloudpss/job/TemplateCompiler.py,sha256=MuJDTQ54wRo5bGSvBJBJjXJ7u463dwpRkaLwIwm_hLE,9936
|
35
35
|
cloudpss/job/TemplateManager.py,sha256=uOvctmE3P17aGWt_26d940FbRUSEs6iovFBb8T5xjd4,1115
|
36
36
|
cloudpss/job/__init__.py,sha256=3UIFZYjJTzuckM61o8kim1c3PWt2SSHTL72jrGu5IzI,51
|
37
|
-
cloudpss/job/job.py,sha256=
|
37
|
+
cloudpss/job/job.py,sha256=pV-J0VBnyExIabzt2hMnIvLFdowWz-QT0DuR80Gv9AE,8297
|
38
38
|
cloudpss/job/jobReceiver.py,sha256=PNYxcN33LiXZVyc4tzhPlpWxKnyWO_ElKjJ9wsxsroI,925
|
39
|
-
cloudpss/job/messageStreamReceiver.py,sha256
|
40
|
-
cloudpss/job/messageStreamSender.py,sha256=
|
41
|
-
cloudpss/job/result/EMTResult.py,sha256=
|
39
|
+
cloudpss/job/messageStreamReceiver.py,sha256=-U9rmGRvU-qFZQNIuHAizsPf9EbrcH66mA8EVGwpIpU,5546
|
40
|
+
cloudpss/job/messageStreamSender.py,sha256=QQO6XtoZNLiUJXeSZmim-XFDBrb9i-JAjMPHKXcscZA,2365
|
41
|
+
cloudpss/job/result/EMTResult.py,sha256=GHgpdDO7-C4M-HFb91h4ZSLWEAm1ZuOm3zOeFCdkmYc,8151
|
42
42
|
cloudpss/job/result/IESLabSimulationResult.py,sha256=a47Ic1vvfHTK_vEokOZxJBnQReqYOWux_aePPic_Hrs,84
|
43
|
-
cloudpss/job/result/IESLabTypicalDayResult.py,sha256=
|
44
|
-
cloudpss/job/result/IESResult.py,sha256=
|
43
|
+
cloudpss/job/result/IESLabTypicalDayResult.py,sha256=tpWfN3G34l3qSXaTDDdPRSTXR4p7jY3AlP7o9e-A3VI,9554
|
44
|
+
cloudpss/job/result/IESResult.py,sha256=sLTdwZLE2HyZZNvJATgibsOPm3lqYquvLyOJjEgfog0,4027
|
45
45
|
cloudpss/job/result/PowerFlowResult.py,sha256=KoImlmsEEZyMriuoE_MSHBQu4k9MSDUuZ8E2SRLndWE,2097
|
46
|
-
cloudpss/job/result/__init__.py,sha256=
|
47
|
-
cloudpss/job/result/result.py,sha256=
|
46
|
+
cloudpss/job/result/__init__.py,sha256=dRWZNoX33cukgrNl6sMkQM3hdQrGHCpwIktoayrpP_4,1594
|
47
|
+
cloudpss/job/result/result.py,sha256=UvtHWNPhVq1NsmuE4m-iy9BywacgLCYRfQMEBusFdpc,4290
|
48
48
|
cloudpss/model/__init__.py,sha256=SNq-bfwcQtDHtTNBYppfUEs8wkjfrQfGeywx7igmvOs,151
|
49
49
|
cloudpss/model/jobDefinitions.py,sha256=uuTwpqStlg3YDmfxbU2PVi_Tf18opa0kYLCMGaOP-qA,3749
|
50
|
-
cloudpss/model/model.py,sha256=
|
50
|
+
cloudpss/model/model.py,sha256=UOtHdqS6ARPSWoMKllryqJ4PZg_mJefu6FB2wWZlOWo,26782
|
51
51
|
cloudpss/model/revision.py,sha256=IFznBKirwpfqadyCNJWPGL7lTpQxbCmU1fxdI5AvoA4,4002
|
52
52
|
cloudpss/model/topology.py,sha256=MJF3rQBLWus4RVO6L3Zwih7SWYjRWsLMcrcIBxCmIwM,2617
|
53
53
|
cloudpss/model/implements/__init__.py,sha256=88L_wF9SSzxsbtqwStWIPH4LxaKq7TVcssHQ62YBnls,67
|
54
54
|
cloudpss/model/implements/component.py,sha256=uNSpkZKChdXLiO40Ev4P3oQ1di2Hu4YjcBOb0I8Bf0c,734
|
55
|
-
cloudpss/model/implements/diagram.py,sha256
|
55
|
+
cloudpss/model/implements/diagram.py,sha256=-r9tTAIT_ET8ClPjcefAlBsMf2f1BytUi2F0L8pfdVc,6115
|
56
56
|
cloudpss/model/implements/implement.py,sha256=Uld96tjXVDbVUNV8xscyy_nZWLHr3iP2DqA6S3p-XJE,954
|
57
57
|
cloudpss/project/__init__.py,sha256=fpskY-cJGmMcTg1naVzNPtJaRG1xmSc2CFjDTin64Cw,51
|
58
58
|
cloudpss/project/project.py,sha256=uFhOnM8ngo1_ZYz2uArtORKZquYNdOIVLXU_q1MDFI4,17698
|
59
59
|
cloudpss/runner/DSLabResult.py,sha256=xJqKA3e1KSXQmLDe9_T6fG1exdE9j7EjfIfvBMmqiJ8,3422
|
60
60
|
cloudpss/runner/IESLabEvaluationResult.py,sha256=rsKbSJ9zsgyMYP-oIWsJlSXGxs7Y-44rj45Fn6NJXMA,5998
|
61
61
|
cloudpss/runner/IESLabPlanResult.py,sha256=pbUq2YCPBE01Sy9e9X5Wp8OZ4PJhUkUb-28b5CEzqxc,8874
|
62
|
-
cloudpss/runner/IESLabTypicalDayResult.py,sha256
|
62
|
+
cloudpss/runner/IESLabTypicalDayResult.py,sha256=lr8ID_Wk4zJagirReFoBJdedXoxUYt4CSQH9uZD6kKo,8179
|
63
63
|
cloudpss/runner/MessageStreamReceiver.py,sha256=dT-rKslQbRt3bMTGXupa1YrocHl2zTWOCHlsXcbgfhs,2812
|
64
64
|
cloudpss/runner/__init__.py,sha256=FxiYYmssbZgRjieySzi43yPiWEF6eNos2UsoFQeD2H8,341
|
65
65
|
cloudpss/runner/receiver.py,sha256=QU0RsbCt0EK7sCLHzfj8_QQsuPNfqXxpZi5JKm6roxA,4162
|
66
|
-
cloudpss/runner/result.py,sha256=
|
67
|
-
cloudpss/runner/runner.py,sha256=
|
66
|
+
cloudpss/runner/result.py,sha256=Q8RcfUnvilxPo6yvtjH6dXePaCqrBjQCljur3rem2pU,13290
|
67
|
+
cloudpss/runner/runner.py,sha256=oCK1PdDNArk25v9S7xvE5r6xfQu0EKHKuxKQN0CLUHE,10093
|
68
68
|
cloudpss/runner/storage.py,sha256=zFET_zwPIOF2Cnh9sgFiS0HFxV1OmVsU34bGUQ6PpkA,4162
|
69
69
|
cloudpss/runner/transform.py,sha256=krOgTZiJSJAb5QSwerAqlbC4Ma0PKi__0WOZlAxw4O8,11613
|
70
70
|
cloudpss/utils/IO.py,sha256=FsFp3V8I1-P0YiBGmjKwbMalBrVKMHUxTjFZFOtv0CQ,5357
|
71
71
|
cloudpss/utils/__init__.py,sha256=jWVHSOqJQWU0fpg2UbWSEQoLCb2Uys-vH5Uqkb0ihNA,326
|
72
72
|
cloudpss/utils/dataEncoder.py,sha256=5PUPb844eOGgFnYrMM8bdjdKH_MZz0lk-67uo8TvwEo,885
|
73
73
|
cloudpss/utils/graphqlUtil.py,sha256=zGEhRZvy5JMipFKFxjDmbc-HQP3aPZ5noDwi-RTXWSk,280
|
74
|
-
cloudpss/utils/httprequests.py,sha256=
|
74
|
+
cloudpss/utils/httprequests.py,sha256=Ewxc3AWarQp46-kDTasUC18TfIRpuuBSh5I9wvK0aCI,1881
|
75
75
|
cloudpss/utils/matlab.py,sha256=SLwVt790BjklJK2XNELt9R2n_1ej9Y8QsTIdFkKXLWE,795
|
76
76
|
cloudpss/utils/yamlLoader.py,sha256=bv_vPDK_e0n_vZ5FwpDJ_NJWqMAwfU3AbhkvQIxPCy4,2677
|
77
|
-
cloudpss-4.5.
|
78
|
-
cloudpss-4.5.
|
79
|
-
cloudpss-4.5.
|
80
|
-
cloudpss-4.5.
|
77
|
+
cloudpss-4.5.14.dist-info/METADATA,sha256=bu2kZXqqINjgJYYmZSTf3LZrZ_0PYkouWlXzO1oBB9I,2402
|
78
|
+
cloudpss-4.5.14.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
79
|
+
cloudpss-4.5.14.dist-info/top_level.txt,sha256=wS9qPU4-aWM9ouzMOx34Nlq-GkdQKpr9vBskwut1BD8,9
|
80
|
+
cloudpss-4.5.14.dist-info/RECORD,,
|
File without changes
|
File without changes
|