cloudpss 4.5.2__tar.gz → 4.5.3__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.3}/PKG-INFO +1 -1
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/model/implements/diagram.py +34 -7
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/model/model.py +3 -2
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/utils/IO.py +3 -1
- cloudpss-4.5.3/cloudpss/version.py +1 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss.egg-info/PKG-INFO +1 -1
- cloudpss-4.5.2/cloudpss/version.py +0 -1
- {cloudpss-4.5.2 → cloudpss-4.5.3}/README.md +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/asyncio/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/asyncio/job/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/asyncio/job/job.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/asyncio/job/messageStreamReceiver.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/asyncio/job/messageStreamSender.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/asyncio/model/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/asyncio/model/model.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/asyncio/model/revision.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/asyncio/model/topology.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/asyncio/utils/AsyncIterable.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/asyncio/utils/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/asyncio/utils/httpAsyncRequest.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/function/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/function/function.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/function/functionExecution.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/function/job.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/ieslab/DataManageModel.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/ieslab/EvaluationModel.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/ieslab/IESLabOpt.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/ieslab/IESLabPlan.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/ieslab/IESLabSimulation.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/ieslab/PlanModel.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/ieslab/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/job/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/job/job.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/job/jobReceiver.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/job/messageStreamReceiver.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/job/messageStreamSender.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/job/result/EMTResult.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/job/result/IESLabSimulationResult.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/job/result/IESLabTypicalDayResult.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/job/result/IESResult.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/job/result/PowerFlowResult.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/job/result/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/job/result/result.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/model/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/model/implements/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/model/implements/component.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/model/implements/implement.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/model/jobDefinitions.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/model/revision.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/model/topology.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/project/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/project/project.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/runner/IESLabEvaluationResult.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/runner/IESLabPlanResult.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/runner/IESLabTypicalDayResult.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/runner/MessageStreamReceiver.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/runner/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/runner/receiver.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/runner/result.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/runner/runner.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/runner/storage.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/runner/transform.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/utils/__init__.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/utils/dataEncoder.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/utils/graphqlUtil.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/utils/httprequests.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/utils/matlab.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/utils/yamlLoader.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss/verify.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss.egg-info/SOURCES.txt +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss.egg-info/dependency_links.txt +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss.egg-info/requires.txt +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/cloudpss.egg-info/top_level.txt +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/setup.cfg +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/setup.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test-async.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test-async2.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test-async3.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test-plot.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test-plot1.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test-sdk.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test-sdk1.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test-snapshot.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test-topology.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test-topology1.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test-yield.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test11.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test12.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test7950.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/testAsync.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/testEvent.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/testRt-test.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/testRt.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/testRt2.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/testSend.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test_in_new_web_1.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test_modepower_ampratio(3).py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test_ws.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/test_ws2.py +0 -0
- {cloudpss-4.5.2 → cloudpss-4.5.3}/test/testb.py +0 -0
@@ -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
|
"""
|
@@ -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.3'
|
@@ -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
|
File without changes
|
File without changes
|