cloudpss 4.5.8__tar.gz → 4.5.10__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.8 → cloudpss-4.5.10}/PKG-INFO +1 -1
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/function/functionExecution.py +37 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/ieslab/DataManageModel.py +12 -3
- cloudpss-4.5.10/cloudpss/version.py +1 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss.egg-info/PKG-INFO +1 -1
- cloudpss-4.5.8/cloudpss/version.py +0 -1
- {cloudpss-4.5.8 → cloudpss-4.5.10}/README.md +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/__init__.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/asyncio/__init__.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/asyncio/job/__init__.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/asyncio/job/job.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/asyncio/job/messageStreamReceiver.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/asyncio/job/messageStreamSender.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/asyncio/model/__init__.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/asyncio/model/model.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/asyncio/model/revision.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/asyncio/model/topology.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/asyncio/utils/AsyncIterable.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/asyncio/utils/__init__.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/asyncio/utils/httpAsyncRequest.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/function/__init__.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/function/function.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/function/job.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/ieslab/EvaluationModel.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/ieslab/IESLabOpt.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/ieslab/IESLabPlan.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/ieslab/IESLabSimulation.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/ieslab/PlanModel.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/ieslab/__init__.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/job/__init__.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/job/job.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/job/jobReceiver.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/job/messageStreamReceiver.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/job/messageStreamSender.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/job/result/EMTResult.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/job/result/IESLabSimulationResult.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/job/result/IESLabTypicalDayResult.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/job/result/IESResult.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/job/result/PowerFlowResult.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/job/result/__init__.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/job/result/result.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/model/__init__.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/model/implements/__init__.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/model/implements/component.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/model/implements/diagram.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/model/implements/implement.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/model/jobDefinitions.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/model/model.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/model/revision.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/model/topology.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/project/__init__.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/project/project.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/runner/IESLabEvaluationResult.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/runner/IESLabPlanResult.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/runner/IESLabTypicalDayResult.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/runner/MessageStreamReceiver.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/runner/__init__.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/runner/receiver.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/runner/result.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/runner/runner.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/runner/storage.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/runner/transform.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/utils/IO.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/utils/__init__.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/utils/dataEncoder.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/utils/graphqlUtil.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/utils/httprequests.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/utils/matlab.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/utils/yamlLoader.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss/verify.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss.egg-info/SOURCES.txt +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss.egg-info/dependency_links.txt +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss.egg-info/requires.txt +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/cloudpss.egg-info/top_level.txt +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/setup.cfg +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/setup.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test-async.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test-async2.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test-async3.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test-plot.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test-plot1.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test-sdk.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test-sdk1.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test-snapshot.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test-topology.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test-topology1.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test-yield.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test11.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test12.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test7950.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/testAsync.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/testEvent.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/testRt-test.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/testRt.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/testRt2.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/testSend.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test_in_new_web_1.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test_modepower_ampratio(3).py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test_ws.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test_ws2.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/test_ws3.py +0 -0
- {cloudpss-4.5.8 → cloudpss-4.5.10}/test/testb.py +0 -0
@@ -4,6 +4,8 @@ import json
|
|
4
4
|
import signal
|
5
5
|
import sys
|
6
6
|
from ..utils import MatlabDataEncoder
|
7
|
+
import threading
|
8
|
+
import queue
|
7
9
|
|
8
10
|
|
9
11
|
class EventSample(object):
|
@@ -23,7 +25,23 @@ class EventSample(object):
|
|
23
25
|
eventHandlerKwargs] in self.__eventHandlerSample:
|
24
26
|
eventHandlerSample(*eventHandlerArgs, **eventHandlerKwargs)
|
25
27
|
|
28
|
+
class EventInput(object):
|
29
|
+
def __init__(self):
|
30
|
+
self.__eventHandlerSample = []
|
26
31
|
|
32
|
+
def __iadd__(self, EventHandler):
|
33
|
+
self.__eventHandlerSample.append(EventHandler)
|
34
|
+
return self
|
35
|
+
|
36
|
+
def __isub__(self, EventHandler):
|
37
|
+
self.__eventHandlerSample.remove(EventHandler)
|
38
|
+
return self
|
39
|
+
|
40
|
+
def __call__(self, *args, **kwargs):
|
41
|
+
for [eventHandlerSample] in self.__eventHandlerSample:
|
42
|
+
# 调用事件处理程序
|
43
|
+
if eventHandlerSample:
|
44
|
+
eventHandlerSample(*args, **kwargs)
|
27
45
|
class Args(dict):
|
28
46
|
"""
|
29
47
|
参数类
|
@@ -87,7 +105,9 @@ class FunctionExecution(object):
|
|
87
105
|
self.token = kwargs.get('token', None)
|
88
106
|
self.functionToken = kwargs.get('functionToken', None)
|
89
107
|
self.__abortedEvents = EventSample()
|
108
|
+
self.__inputEvents = EventInput()
|
90
109
|
self._args = None
|
110
|
+
self.__input_thread = None
|
91
111
|
signal.signal(signal.SIGINT, self._on_abort)
|
92
112
|
|
93
113
|
@property
|
@@ -185,6 +205,23 @@ class FunctionExecution(object):
|
|
185
205
|
'''
|
186
206
|
sys.exit(code)
|
187
207
|
|
208
|
+
def input_thread(self):
|
209
|
+
while True:
|
210
|
+
user_input = input()
|
211
|
+
self.__inputEvents(user_input)
|
212
|
+
|
213
|
+
def on_input(self, func):
|
214
|
+
"""
|
215
|
+
监听input事件
|
216
|
+
|
217
|
+
:params func 响应后的回调函数
|
218
|
+
"""
|
219
|
+
if self.__input_thread is None:
|
220
|
+
self.__input_thread = threading.Thread(target=self.input_thread, args=())
|
221
|
+
self.__input_thread.start()
|
222
|
+
self.log('cloudpss input stream is ready', 'debug')
|
223
|
+
self.__inputEvents += [func]
|
224
|
+
|
188
225
|
def print(self, data):
|
189
226
|
print(json.dumps(data, cls=MatlabDataEncoder)+'\n', flush=True)
|
190
227
|
|
@@ -83,7 +83,7 @@ class DataManageModel(object):
|
|
83
83
|
|
84
84
|
:return: 无
|
85
85
|
'''
|
86
|
-
list = ['thermalLoads', 'heatingLoad', 'coolingLoad', 'electricLoads', 'fuels', 'typhoon', 'rainfall', 'earthquake', 'extremeCold', 'HydrogenLoad']
|
86
|
+
list = ['thermalLoads', 'heatingLoad', 'coolingLoad', 'electricLoads', 'fuels', 'typhoon', 'rainfall', 'earthquake', 'extremeCold', 'HydrogenLoad', 'ammoniaLoad']
|
87
87
|
for kind,value in self._kindUrlMap.items():
|
88
88
|
try:
|
89
89
|
if kind in list:
|
@@ -125,6 +125,7 @@ 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)
|
128
129
|
return copy.deepcopy(self._kindItemDataMap[kind])
|
129
130
|
|
130
131
|
def AddDataItem(self, dataType, data):
|
@@ -151,7 +152,7 @@ class DataManageModel(object):
|
|
151
152
|
self._kindIdMap[str(data['id'])]=kind
|
152
153
|
self._itemDataMap[str(data['timeid'])]=data
|
153
154
|
self._itemDataMap[str(data['id'])]=data
|
154
|
-
if kind in ['thermalLoads', 'heatingLoad','coolingLoad', 'electricLoads', 'fuels']:
|
155
|
+
if kind in ['thermalLoads', 'heatingLoad','coolingLoad', 'electricLoads', 'fuels', 'ammoniaLoad']:
|
155
156
|
dataList = self._fetchItemData(self._kindUrlMap[kind], None)
|
156
157
|
self._kindItemDataMap[kind] = dataList
|
157
158
|
return dataList[-1]['id']
|
@@ -490,7 +491,11 @@ class IESOptDataManageModel(DataManageModel):
|
|
490
491
|
"氢气压缩设备": "HydrogenCompression",
|
491
492
|
"氢负荷": "HydrogenLoad",
|
492
493
|
"氢": "HydrogenProductionFuels",
|
493
|
-
"运氢槽车": "HydrogenTanker"
|
494
|
+
"运氢槽车": "HydrogenTanker",
|
495
|
+
"制氨设备": "AmmoniaProduction",
|
496
|
+
"储氨罐": "AmmoniaStoTank",
|
497
|
+
"制氮设备": "NitrogenProduction",
|
498
|
+
"氨负荷": "ammoniaLoad",
|
494
499
|
}
|
495
500
|
_kindUrlMap = {
|
496
501
|
"PhotovoltaicSys": "api/ieslab-opt/rest/dpcs/",
|
@@ -537,5 +542,9 @@ class IESOptDataManageModel(DataManageModel):
|
|
537
542
|
"ALK": "api/ieslab-opt/rest/hpc/",
|
538
543
|
"PEME": "api/ieslab-opt/rest/hpc/",
|
539
544
|
"SOEC": "api/ieslab-opt/rest/hpc/",
|
545
|
+
"AmmoniaProduction": "api/ieslab-opt/rest/apc/",
|
546
|
+
"AmmoniaStoTank": "api/ieslab-opt/rest/esc/",
|
547
|
+
"NitrogenProduction": "api/ieslab-opt/rest/asec/",
|
548
|
+
"ammoniaLoad": "api/ieslab-opt/rest/ammoniaLoad/",
|
540
549
|
}
|
541
550
|
pass
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = '4.5.10'
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = '4.5.8'
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|