fmu-manipulation-toolbox 1.8.4.3b0__tar.gz → 1.9rc0__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.
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/PKG-INFO +1 -1
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/README.md +8 -3
- fmu_manipulation_toolbox-1.9rc0/fmu_manipulation_toolbox/__version__.py +1 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/assembly.py +13 -6
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/container.py +14 -20
- fmu_manipulation_toolbox-1.9rc0/fmu_manipulation_toolbox/resources/linux64/container.so +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/win32/client_sm.dll +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/win32/server_sm.exe +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/win64/client_sm.dll +0 -0
- fmu_manipulation_toolbox-1.9rc0/fmu_manipulation_toolbox/resources/win64/container.dll +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/win64/server_sm.exe +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/split.py +25 -9
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox.egg-info/PKG-INFO +1 -1
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/tests/test_suite.py +10 -0
- fmu_manipulation_toolbox-1.8.4.3b0/fmu_manipulation_toolbox/__version__.py +0 -1
- fmu_manipulation_toolbox-1.8.4.3b0/fmu_manipulation_toolbox/resources/linux64/container.so +0 -0
- fmu_manipulation_toolbox-1.8.4.3b0/fmu_manipulation_toolbox/resources/win64/container.dll +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/LICENSE.txt +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/__init__.py +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/__main__.py +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/checker.py +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/gui.py +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/gui_style.py +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/help.py +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/operations.py +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/checkbox-checked-disabled.png +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/checkbox-checked-hover.png +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/checkbox-checked.png +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/checkbox-unchecked-disabled.png +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/checkbox-unchecked-hover.png +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/checkbox-unchecked.png +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/container.png +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/drop_fmu.png +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2Annotation.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2AttributeGroups.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2ModelDescription.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2ScalarVariable.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2Type.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2Unit.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2VariableDependency.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Annotation.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3AttributeGroups.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3BuildDescription.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3InterfaceType.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3LayeredStandardManifest.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3ModelDescription.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Terminal.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3TerminalsAndIcons.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Type.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Unit.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Variable.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3VariableDependency.xsd +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmu.png +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/fmu_manipulation_toolbox.png +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/help.png +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/icon-round.png +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/icon.png +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/icon_fmu.png +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/license.txt +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/linux32/client_sm.so +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/linux32/server_sm +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/linux64/client_sm.so +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/linux64/server_sm +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/mask.png +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/resources/model.png +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox/version.py +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox.egg-info/SOURCES.txt +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox.egg-info/dependency_links.txt +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox.egg-info/entry_points.txt +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox.egg-info/requires.txt +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/fmu_manipulation_toolbox.egg-info/top_level.txt +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/setup.cfg +0 -0
- {fmu_manipulation_toolbox-1.8.4.3b0 → fmu_manipulation_toolbox-1.9rc0}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fmu_manipulation_toolbox
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.9rc0
|
|
4
4
|
Summary: FMU Manipulation Toolbox is a python application for modifying Functional Mock-up Units (FMUs) without recompilation or bundling them into FMU Containers
|
|
5
5
|
Home-page: https://github.com/grouperenault/fmu_manipulation_toolbox/
|
|
6
6
|
Author: Nicolas.LAURENT@Renault.com
|
|
@@ -131,24 +131,29 @@ optional arguments:
|
|
|
131
131
|
### FMU Containers
|
|
132
132
|
|
|
133
133
|
```
|
|
134
|
-
usage: fmucontainer [-h] [-fmu-directory FMU_DIRECTORY] -
|
|
135
|
-
|
|
134
|
+
usage: fmucontainer [-h] [-fmu-directory FMU_DIRECTORY] [-fmi FMI_VERSION]
|
|
135
|
+
-container filename.{csv|json|ssp},[:step_size] [-debug] [-no-auto-input] [-no-auto-output]
|
|
136
|
+
[-auto-parameter] [-auto-local] [-no-auto-link] [-mt] [-profile] [-sequential] [-dump-json]
|
|
136
137
|
|
|
137
138
|
Generate FMU from FMU's
|
|
138
139
|
|
|
139
|
-
|
|
140
|
+
options:
|
|
140
141
|
-h, -help
|
|
141
142
|
-fmu-directory FMU_DIRECTORY Directory containing initial FMU’s and used to generate containers. If not defined,
|
|
142
143
|
current directory is used. (default: .)
|
|
144
|
+
-fmi FMI_VERSION Define version of FMI to be used for container interface.Only '2' or '3' is
|
|
145
|
+
supported. (default: 2)
|
|
143
146
|
-container filename.{csv|json|ssp},[:step_size]
|
|
144
147
|
Description of the container to create. (default: [])
|
|
145
148
|
-debug Add lot of useful log during the process. (default: False)
|
|
146
149
|
-no-auto-input Create ONLY explicit input. (default: True)
|
|
147
150
|
-no-auto-output Create ONLY explicit output. (default: True)
|
|
148
151
|
-auto-parameter Expose parameters of the embedded fmu's. (default: False)
|
|
152
|
+
-auto-local Expose local variables of the embedded fmu's. (default: False)
|
|
149
153
|
-no-auto-link Create ONLY explicit links. (default: True)
|
|
150
154
|
-mt Enable Multi-Threaded mode for the generated container. (default: False)
|
|
151
155
|
-profile Enable Profiling mode for the generated container. (default: False)
|
|
156
|
+
-sequential Use sequential mode to schedule embedded fmu's. (default: False)
|
|
152
157
|
-dump-json Dump a JSON file for each container. (default: False)
|
|
153
158
|
```
|
|
154
159
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'V1.9-pre0'
|
|
@@ -37,7 +37,7 @@ class Connection:
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
class AssemblyNode:
|
|
40
|
-
def __init__(self, name: Optional[str], step_size: float = None, mt=False, profiling=False,
|
|
40
|
+
def __init__(self, name: Optional[str], step_size: float = None, mt=False, profiling=False, sequential=False,
|
|
41
41
|
auto_link=True, auto_input=True, auto_output=True, auto_parameter=False, auto_local=False):
|
|
42
42
|
self.name = name
|
|
43
43
|
if step_size:
|
|
@@ -50,6 +50,7 @@ class AssemblyNode:
|
|
|
50
50
|
self.step_size = None
|
|
51
51
|
self.mt = mt
|
|
52
52
|
self.profiling = profiling
|
|
53
|
+
self.sequential = sequential
|
|
53
54
|
self.auto_link = auto_link
|
|
54
55
|
self.auto_input = auto_input
|
|
55
56
|
self.auto_output = auto_output
|
|
@@ -138,7 +139,8 @@ class AssemblyNode:
|
|
|
138
139
|
for link_rule in wired.rule_link:
|
|
139
140
|
self.add_link(link_rule[0], link_rule[1], link_rule[2], link_rule[3])
|
|
140
141
|
|
|
141
|
-
container.make_fmu(self.name, self.step_size, mt=self.mt, profiling=self.profiling,
|
|
142
|
+
container.make_fmu(self.name, self.step_size, mt=self.mt, profiling=self.profiling, sequential=self.sequential,
|
|
143
|
+
debug=debug)
|
|
142
144
|
|
|
143
145
|
for node in self.children.values():
|
|
144
146
|
logger.info(f"Deleting transient FMU Container '{node.name}'")
|
|
@@ -216,7 +218,7 @@ class AssemblyError(Exception):
|
|
|
216
218
|
|
|
217
219
|
|
|
218
220
|
class Assembly:
|
|
219
|
-
def __init__(self, filename: str, step_size=None, auto_link=True, auto_input=True, debug=False,
|
|
221
|
+
def __init__(self, filename: str, step_size=None, auto_link=True, auto_input=True, debug=False, sequential=False,
|
|
220
222
|
auto_output=True, mt=False, profiling=False, fmu_directory: Path = Path("."), auto_parameter=False,
|
|
221
223
|
auto_local=False):
|
|
222
224
|
self.filename = Path(filename)
|
|
@@ -228,6 +230,7 @@ class Assembly:
|
|
|
228
230
|
self.default_auto_parameter = auto_parameter
|
|
229
231
|
self.default_auto_local = auto_local
|
|
230
232
|
self.default_mt = mt
|
|
233
|
+
self.default_sequential = sequential
|
|
231
234
|
self.default_profiling = profiling
|
|
232
235
|
self.fmu_directory = fmu_directory
|
|
233
236
|
self.transient_filenames: List[Path] = []
|
|
@@ -283,8 +286,9 @@ class Assembly:
|
|
|
283
286
|
name = str(self.filename.with_suffix(".fmu"))
|
|
284
287
|
self.root = AssemblyNode(name, step_size=self.default_step_size, auto_link=self.default_auto_link,
|
|
285
288
|
mt=self.default_mt, profiling=self.default_profiling,
|
|
286
|
-
|
|
287
|
-
|
|
289
|
+
sequential=self.default_sequential, auto_input=self.default_auto_input,
|
|
290
|
+
auto_output=self.default_auto_output, auto_parameter=self.default_auto_parameter,
|
|
291
|
+
auto_local=self.default_auto_local)
|
|
288
292
|
|
|
289
293
|
with open(self.input_pathname) as file:
|
|
290
294
|
reader = csv.reader(file, delimiter=';')
|
|
@@ -385,6 +389,7 @@ class Assembly:
|
|
|
385
389
|
name = data.get("name", None) # 1
|
|
386
390
|
mt = data.get("mt", self.default_mt) # 2
|
|
387
391
|
profiling = data.get("profiling", self.default_profiling) # 3
|
|
392
|
+
sequential = data.get("sequential", self.default_sequential) # 3b
|
|
388
393
|
auto_link = data.get("auto_link", self.default_auto_link) # 4
|
|
389
394
|
auto_input = data.get("auto_input", self.default_auto_input) # 5
|
|
390
395
|
auto_output = data.get("auto_output", self.default_auto_output) # 6
|
|
@@ -393,11 +398,12 @@ class Assembly:
|
|
|
393
398
|
step_size = data.get("step_size", self.default_step_size) # 7
|
|
394
399
|
|
|
395
400
|
node = AssemblyNode(name, step_size=step_size, auto_link=auto_link, mt=mt, profiling=profiling,
|
|
401
|
+
sequential=sequential,
|
|
396
402
|
auto_input=auto_input, auto_output=auto_output, auto_parameter=auto_parameter,
|
|
397
403
|
auto_local=auto_local)
|
|
398
404
|
|
|
399
405
|
for key, value in data.items():
|
|
400
|
-
if key in ('name', 'step_size', 'auto_link', 'auto_input', 'auto_output', 'mt', 'profiling',
|
|
406
|
+
if key in ('name', 'step_size', 'auto_link', 'auto_input', 'auto_output', 'mt', 'profiling', 'sequential',
|
|
401
407
|
'auto_parameter', 'auto_local'):
|
|
402
408
|
continue # Already read
|
|
403
409
|
|
|
@@ -455,6 +461,7 @@ class Assembly:
|
|
|
455
461
|
json_node["name"] = node.name # 1
|
|
456
462
|
json_node["mt"] = node.mt # 2
|
|
457
463
|
json_node["profiling"] = node.profiling # 3
|
|
464
|
+
json_node["sequential"] = node.sequential # 3b
|
|
458
465
|
json_node["auto_link"] = node.auto_link # 4
|
|
459
466
|
json_node["auto_input"] = node.auto_input # 5
|
|
460
467
|
json_node["auto_output"] = node.auto_output # 6
|
|
@@ -16,15 +16,15 @@ logger = logging.getLogger("fmu_manipulation_toolbox")
|
|
|
16
16
|
|
|
17
17
|
class FMUPort:
|
|
18
18
|
def __init__(self, attrs: Dict[str, str]):
|
|
19
|
-
self.causality = attrs.
|
|
20
|
-
self.variability = attrs.
|
|
21
|
-
self.name = attrs.
|
|
22
|
-
self.vr = int(attrs.
|
|
23
|
-
self.description = attrs.
|
|
19
|
+
self.causality = attrs.get("causality", "local")
|
|
20
|
+
self.variability = attrs.get("variability", "continuous")
|
|
21
|
+
self.name = attrs.get("name")
|
|
22
|
+
self.vr = int(attrs.get("valueReference"))
|
|
23
|
+
self.description = attrs.get("description", None)
|
|
24
24
|
|
|
25
|
-
self.type_name = attrs.
|
|
26
|
-
self.start_value = attrs.
|
|
27
|
-
self.initial = attrs.
|
|
25
|
+
self.type_name = attrs.get("type_name", None)
|
|
26
|
+
self.start_value = attrs.get("start", None)
|
|
27
|
+
self.initial = attrs.get("initial", None)
|
|
28
28
|
|
|
29
29
|
def set_port_type(self, type_name: str, attrs: Dict[str, str]):
|
|
30
30
|
self.type_name = type_name
|
|
@@ -465,7 +465,7 @@ class FMUContainer:
|
|
|
465
465
|
logger.warning(f"{cport} is not connected")
|
|
466
466
|
|
|
467
467
|
def make_fmu(self, fmu_filename: Union[str, Path], step_size: Optional[float] = None, debug=False, mt=False,
|
|
468
|
-
profiling=False):
|
|
468
|
+
profiling=False, sequential=False):
|
|
469
469
|
if isinstance(fmu_filename, str):
|
|
470
470
|
fmu_filename = Path(fmu_filename)
|
|
471
471
|
|
|
@@ -481,7 +481,7 @@ class FMUContainer:
|
|
|
481
481
|
with open(base_directory / "modelDescription.xml", "wt") as xml_file:
|
|
482
482
|
self.make_fmu_xml(xml_file, step_size, profiling)
|
|
483
483
|
with open(resources_directory / "container.txt", "wt") as txt_file:
|
|
484
|
-
self.make_fmu_txt(txt_file, step_size, mt, profiling)
|
|
484
|
+
self.make_fmu_txt(txt_file, step_size, mt, profiling, sequential)
|
|
485
485
|
|
|
486
486
|
self.make_fmu_package(base_directory, fmu_filename)
|
|
487
487
|
if not debug:
|
|
@@ -594,16 +594,10 @@ class FMUContainer:
|
|
|
594
594
|
</fmiModelDescription>
|
|
595
595
|
""")
|
|
596
596
|
|
|
597
|
-
def make_fmu_txt(self, txt_file, step_size: float, mt: bool, profiling: bool):
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
print("# Don't use MT\n0", file=txt_file)
|
|
602
|
-
|
|
603
|
-
if profiling:
|
|
604
|
-
print("# Profiling ENABLED\n1", file=txt_file)
|
|
605
|
-
else:
|
|
606
|
-
print("# Profiling DISABLED\n0", file=txt_file)
|
|
597
|
+
def make_fmu_txt(self, txt_file, step_size: float, mt: bool, profiling: bool, sequential: bool):
|
|
598
|
+
print("# Container flags <MT> <Profiling> <Sequential>", file=txt_file)
|
|
599
|
+
flags = [ str(int(flag == True)) for flag in (mt, profiling, sequential)]
|
|
600
|
+
print(" ".join(flags), file=txt_file)
|
|
607
601
|
|
|
608
602
|
print(f"# Internal time step in seconds", file=txt_file)
|
|
609
603
|
print(f"{step_size}", file=txt_file)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -40,6 +40,7 @@ class FMUSplitter:
|
|
|
40
40
|
def __init__(self, fmu_filename: str):
|
|
41
41
|
self.fmu_filename = Path(fmu_filename)
|
|
42
42
|
self.directory = self.fmu_filename.with_suffix(".dir")
|
|
43
|
+
self.zip = None # to handle error
|
|
43
44
|
self.zip = zipfile.ZipFile(self.fmu_filename)
|
|
44
45
|
self.filenames_list = self.zip.namelist()
|
|
45
46
|
self.dir_set = self.get_dir_set()
|
|
@@ -58,8 +59,9 @@ class FMUSplitter:
|
|
|
58
59
|
return dir_set
|
|
59
60
|
|
|
60
61
|
def __del__(self):
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
if self.zip is not None:
|
|
63
|
+
logger.debug("Closing zip file")
|
|
64
|
+
self.zip.close()
|
|
63
65
|
|
|
64
66
|
def split_fmu(self):
|
|
65
67
|
logger.info(f"Splitting...")
|
|
@@ -178,8 +180,18 @@ class FMUSplitterDescription:
|
|
|
178
180
|
parser.ParseFile(file)
|
|
179
181
|
|
|
180
182
|
def parse_txt_file_header(self, file, txt_filename):
|
|
181
|
-
|
|
182
|
-
|
|
183
|
+
flags = self.get_line(file).split(" ")
|
|
184
|
+
if len(flags) == 1:
|
|
185
|
+
self.config["mt"] = flags[0] == "1"
|
|
186
|
+
self.config["profiling"] = self.get_line(file) == "1"
|
|
187
|
+
self.config["sequential"] = False
|
|
188
|
+
elif len(flags) == 3:
|
|
189
|
+
self.config["mt"] = flags[0] == "1"
|
|
190
|
+
self.config["profiling"] = flags[1] == "1"
|
|
191
|
+
self.config["sequential"] = flags[2] == "1"
|
|
192
|
+
else:
|
|
193
|
+
raise FMUSplitterError(f"Cannot interpret flags '{flags}'")
|
|
194
|
+
|
|
183
195
|
self.config["step_size"] = float(self.get_line(file))
|
|
184
196
|
nb_fmu = int(self.get_line(file))
|
|
185
197
|
logger.debug(f"Number of FMUs: {nb_fmu}")
|
|
@@ -188,10 +200,15 @@ class FMUSplitterDescription:
|
|
|
188
200
|
for i in range(nb_fmu):
|
|
189
201
|
fmu_filename = self.get_line(file)
|
|
190
202
|
base_directory = "/".join(txt_filename.split("/")[0:-1])
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
203
|
+
|
|
204
|
+
directory = f"{base_directory}/{fmu_filename}"
|
|
205
|
+
if f"{directory}/modelDescription.xml" not in self.zip.namelist():
|
|
206
|
+
directory = f"{base_directory}/{i:02x}"
|
|
207
|
+
if f"{directory}/modelDescription.xml" not in self.zip.namelist():
|
|
208
|
+
print(self.zip.namelist())
|
|
209
|
+
raise FMUSplitterError(f"Cannot find in FMU directory in {directory}.")
|
|
210
|
+
|
|
211
|
+
self.parse_model_description(directory, fmu_filename)
|
|
195
212
|
self.config["candidate_fmu"].append(fmu_filename)
|
|
196
213
|
_library = self.get_line(file)
|
|
197
214
|
_uuid = self.get_line(file)
|
|
@@ -241,7 +258,6 @@ class FMUSplitterDescription:
|
|
|
241
258
|
self.parse_txt_file_header(file, txt_filename)
|
|
242
259
|
self.parse_txt_file_ports(file)
|
|
243
260
|
|
|
244
|
-
|
|
245
261
|
for fmu_filename in self.config["candidate_fmu"]:
|
|
246
262
|
# Inputs per FMUs
|
|
247
263
|
for fmi_type in ("Real", "Integer", "Boolean", "String"):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fmu_manipulation_toolbox
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.9rc0
|
|
4
4
|
Summary: FMU Manipulation Toolbox is a python application for modifying Functional Mock-up Units (FMUs) without recompilation or bundling them into FMU Containers
|
|
5
5
|
Home-page: https://github.com/grouperenault/fmu_manipulation_toolbox/
|
|
6
6
|
Author: Nicolas.LAURENT@Renault.com
|
|
@@ -72,6 +72,16 @@ class FMUManipulationToolboxTestSuite(unittest.TestCase):
|
|
|
72
72
|
self.assert_identical_files("containers/bouncing_ball/REF-bouncing.json",
|
|
73
73
|
"containers/bouncing_ball/bouncing.json")
|
|
74
74
|
|
|
75
|
+
def test_container_bouncing_ball_seq(self):
|
|
76
|
+
assembly = Assembly("bouncing-seq.csv", fmu_directory=Path("containers/bouncing_ball"), mt=True, debug=True,
|
|
77
|
+
sequential=True)
|
|
78
|
+
assembly.write_json("bouncing-seq.json")
|
|
79
|
+
assembly.make_fmu()
|
|
80
|
+
self.assert_identical_files("containers/bouncing_ball/REF-container-seq.txt",
|
|
81
|
+
"containers/bouncing_ball/bouncing-seq/resources/container.txt")
|
|
82
|
+
self.assert_identical_files("containers/bouncing_ball/REF-bouncing-seq.json",
|
|
83
|
+
"containers/bouncing_ball/bouncing-seq.json")
|
|
84
|
+
|
|
75
85
|
def test_container_bouncing_ball_profiling(self):
|
|
76
86
|
assembly = Assembly("bouncing-profiling.csv", fmu_directory=Path("containers/bouncing_ball"), profiling=True,
|
|
77
87
|
debug=True)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'V1.8.4.3-beta'
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|