fmu-manipulation-toolbox 1.9rc10__tar.gz → 1.9.1__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.9rc10 → fmu_manipulation_toolbox-1.9.1}/PKG-INFO +1 -1
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/__main__.py +1 -1
- fmu_manipulation_toolbox-1.9.1/fmu_manipulation_toolbox/__version__.py +1 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/assembly.py +13 -6
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/checker.py +21 -2
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/cli/fmucontainer.py +4 -1
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/cli/fmutool.py +2 -2
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/container.py +27 -7
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/gui.py +2 -2
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/operations.py +9 -1
- fmu_manipulation_toolbox-1.9.1/fmu_manipulation_toolbox/resources/darwin64/container.dylib +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/linux32/client_sm.so +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/linux64/client_sm.so +0 -0
- fmu_manipulation_toolbox-1.9.1/fmu_manipulation_toolbox/resources/linux64/container.so +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/win32/client_sm.dll +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/win32/server_sm.exe +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/win64/client_sm.dll +0 -0
- fmu_manipulation_toolbox-1.9.1/fmu_manipulation_toolbox/resources/win64/container.dll +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/win64/server_sm.exe +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox.egg-info/PKG-INFO +1 -1
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/tests/test_suite.py +6 -0
- fmu_manipulation_toolbox-1.9rc10/fmu_manipulation_toolbox/__version__.py +0 -1
- fmu_manipulation_toolbox-1.9rc10/fmu_manipulation_toolbox/resources/darwin64/container.dylib +0 -0
- fmu_manipulation_toolbox-1.9rc10/fmu_manipulation_toolbox/resources/linux64/container.so +0 -0
- fmu_manipulation_toolbox-1.9rc10/fmu_manipulation_toolbox/resources/win64/container.dll +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/LICENSE.txt +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/README.md +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/__init__.py +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/cli/__init__.py +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/cli/fmusplit.py +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/cli/utils.py +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/gui_style.py +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/help.py +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/remoting.py +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/checkbox-checked-disabled.png +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/checkbox-checked-hover.png +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/checkbox-checked.png +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/checkbox-unchecked-disabled.png +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/checkbox-unchecked-hover.png +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/checkbox-unchecked.png +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/container.png +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/drop_fmu.png +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2Annotation.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2AttributeGroups.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2ModelDescription.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2ScalarVariable.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2Type.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2Unit.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2VariableDependency.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Annotation.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3AttributeGroups.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3BuildDescription.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3InterfaceType.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3LayeredStandardManifest.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3ModelDescription.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Terminal.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3TerminalsAndIcons.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Type.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Unit.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Variable.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3VariableDependency.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmu.png +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/fmu_manipulation_toolbox.png +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/help.png +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/icon-round.png +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/icon.png +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/icon_fmu.png +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/license.txt +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/linux32/server_sm +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/linux64/server_sm +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/mask.png +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/resources/model.png +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/split.py +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/version.py +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox.egg-info/SOURCES.txt +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox.egg-info/dependency_links.txt +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox.egg-info/entry_points.txt +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox.egg-info/requires.txt +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox.egg-info/top_level.txt +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/setup.cfg +0 -0
- {fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/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.9.1
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'V1.9.1'
|
|
@@ -38,7 +38,8 @@ class Connection:
|
|
|
38
38
|
|
|
39
39
|
class AssemblyNode:
|
|
40
40
|
def __init__(self, name: Optional[str], step_size: float = None, mt=False, profiling=False, sequential=False,
|
|
41
|
-
auto_link=True, auto_input=True, auto_output=True, auto_parameter=False, auto_local=False
|
|
41
|
+
auto_link=True, auto_input=True, auto_output=True, auto_parameter=False, auto_local=False,
|
|
42
|
+
ts_multiplier=False):
|
|
42
43
|
self.name = name
|
|
43
44
|
if step_size:
|
|
44
45
|
try:
|
|
@@ -56,6 +57,7 @@ class AssemblyNode:
|
|
|
56
57
|
self.auto_output = auto_output
|
|
57
58
|
self.auto_parameter = auto_parameter
|
|
58
59
|
self.auto_local = auto_local
|
|
60
|
+
self.ts_multiplier = ts_multiplier
|
|
59
61
|
|
|
60
62
|
self.parent: Optional[AssemblyNode] = None
|
|
61
63
|
self.children: Dict[str, AssemblyNode] = {} # sub-containers
|
|
@@ -141,7 +143,7 @@ class AssemblyNode:
|
|
|
141
143
|
self.add_link(link_rule[0], link_rule[1], link_rule[2], link_rule[3])
|
|
142
144
|
|
|
143
145
|
container.make_fmu(self.name, self.step_size, mt=self.mt, profiling=self.profiling, sequential=self.sequential,
|
|
144
|
-
debug=debug)
|
|
146
|
+
debug=debug, ts_multiplier=self.ts_multiplier)
|
|
145
147
|
|
|
146
148
|
for node in self.children.values():
|
|
147
149
|
logger.info(f"Deleting transient FMU Container '{node.name}'")
|
|
@@ -221,7 +223,7 @@ class AssemblyError(Exception):
|
|
|
221
223
|
class Assembly:
|
|
222
224
|
def __init__(self, filename: str, step_size=None, auto_link=True, auto_input=True, debug=False, sequential=False,
|
|
223
225
|
auto_output=True, mt=False, profiling=False, fmu_directory: Path = Path("."), auto_parameter=False,
|
|
224
|
-
auto_local=False):
|
|
226
|
+
auto_local=False, ts_multiplier=False):
|
|
225
227
|
self.filename = Path(filename)
|
|
226
228
|
self.default_auto_input = auto_input
|
|
227
229
|
self.debug = debug
|
|
@@ -233,6 +235,7 @@ class Assembly:
|
|
|
233
235
|
self.default_mt = mt
|
|
234
236
|
self.default_sequential = sequential
|
|
235
237
|
self.default_profiling = profiling
|
|
238
|
+
self.default_ts_multiplier = ts_multiplier
|
|
236
239
|
self.fmu_directory = fmu_directory
|
|
237
240
|
self.transient_filenames: List[Path] = []
|
|
238
241
|
self.transient_dirnames: Set[Path] = set()
|
|
@@ -289,7 +292,7 @@ class Assembly:
|
|
|
289
292
|
mt=self.default_mt, profiling=self.default_profiling,
|
|
290
293
|
sequential=self.default_sequential, auto_input=self.default_auto_input,
|
|
291
294
|
auto_output=self.default_auto_output, auto_parameter=self.default_auto_parameter,
|
|
292
|
-
auto_local=self.default_auto_local)
|
|
295
|
+
auto_local=self.default_auto_local, ts_multiplier=self.default_ts_multiplier)
|
|
293
296
|
|
|
294
297
|
with open(self.input_pathname) as file:
|
|
295
298
|
reader = csv.reader(file, delimiter=';')
|
|
@@ -397,15 +400,16 @@ class Assembly:
|
|
|
397
400
|
auto_parameter = data.get("auto_parameter", self.default_auto_parameter) # 6b
|
|
398
401
|
auto_local = data.get("auto_local", self.default_auto_local) # 6c
|
|
399
402
|
step_size = data.get("step_size", self.default_step_size) # 7
|
|
403
|
+
ts_multiplier = data.get("ts_multiplier", self.default_ts_multiplier) # 7b
|
|
400
404
|
|
|
401
405
|
node = AssemblyNode(name, step_size=step_size, auto_link=auto_link, mt=mt, profiling=profiling,
|
|
402
406
|
sequential=sequential,
|
|
403
407
|
auto_input=auto_input, auto_output=auto_output, auto_parameter=auto_parameter,
|
|
404
|
-
auto_local=auto_local)
|
|
408
|
+
auto_local=auto_local, ts_multiplier=ts_multiplier)
|
|
405
409
|
|
|
406
410
|
for key, value in data.items():
|
|
407
411
|
if key in ('name', 'step_size', 'auto_link', 'auto_input', 'auto_output', 'mt', 'profiling', 'sequential',
|
|
408
|
-
'auto_parameter', 'auto_local'):
|
|
412
|
+
'auto_parameter', 'auto_local', 'ts_multiplier'):
|
|
409
413
|
continue # Already read
|
|
410
414
|
|
|
411
415
|
elif key == "container": # 8
|
|
@@ -472,6 +476,9 @@ class Assembly:
|
|
|
472
476
|
if node.step_size:
|
|
473
477
|
json_node["step_size"] = node.step_size # 7
|
|
474
478
|
|
|
479
|
+
if node.ts_multiplier:
|
|
480
|
+
json_node["ts_multiplier"] = node.ts_multiplier # 7b
|
|
481
|
+
|
|
475
482
|
if node.children:
|
|
476
483
|
json_node["container"] = [self._json_encode_node(child) for child in node.children.values()] # 8
|
|
477
484
|
|
|
@@ -2,8 +2,11 @@ import importlib.util
|
|
|
2
2
|
import inspect
|
|
3
3
|
import logging
|
|
4
4
|
import os
|
|
5
|
+
import sys
|
|
5
6
|
import xmlschema
|
|
7
|
+
from typing import *
|
|
6
8
|
from xmlschema.validators.exceptions import XMLSchemaValidationError
|
|
9
|
+
|
|
7
10
|
from .operations import OperationAbstract
|
|
8
11
|
|
|
9
12
|
logger = logging.getLogger("fmu_manipulation_toolbox")
|
|
@@ -40,8 +43,24 @@ class OperationGenericCheck(OperationAbstract):
|
|
|
40
43
|
else:
|
|
41
44
|
logger.error(f"This FMU does not validate with FMI standard.")
|
|
42
45
|
|
|
46
|
+
_checkers_list: List[type[OperationAbstract]] = [OperationGenericCheck]
|
|
47
|
+
|
|
48
|
+
def get_checkers() -> List[type[OperationAbstract]]:
|
|
49
|
+
if sys.version_info < (3, 10):
|
|
50
|
+
from importlib_metadata import entry_points
|
|
51
|
+
else:
|
|
52
|
+
from importlib.metadata import entry_points
|
|
53
|
+
checkers: List[type[OperationAbstract]] = _checkers_list
|
|
54
|
+
discovered_checkers = entry_points(group='fmu_manipulation_toolbox.checkers')
|
|
55
|
+
|
|
56
|
+
for checker in discovered_checkers:
|
|
57
|
+
entry = checker.load()
|
|
58
|
+
checker_class = entry()
|
|
59
|
+
if issubclass(checker_class, OperationAbstract):
|
|
60
|
+
logger.debug(f"Addon checker: {checker.name}")
|
|
61
|
+
checkers.append(checker_class)
|
|
43
62
|
|
|
44
|
-
|
|
63
|
+
return checkers
|
|
45
64
|
|
|
46
65
|
|
|
47
66
|
def add_from_file(checker_filename: str):
|
|
@@ -59,7 +78,7 @@ def add_from_file(checker_filename: str):
|
|
|
59
78
|
|
|
60
79
|
for checker_name, checker_class in inspect.getmembers(checker_module, inspect.isclass):
|
|
61
80
|
if OperationAbstract in checker_class.__bases__:
|
|
62
|
-
|
|
81
|
+
_checkers_list.append(checker_class)
|
|
63
82
|
logger.info(f"Adding checker: {checker_filename}|{checker_name}")
|
|
64
83
|
|
|
65
84
|
except AttributeError:
|
|
@@ -65,6 +65,9 @@ def fmucontainer(command_options: Sequence[str]):
|
|
|
65
65
|
parser.add_argument("-dump-json", action="store_true", dest="dump", default=False,
|
|
66
66
|
help="Dump a JSON file for each container.")
|
|
67
67
|
|
|
68
|
+
parser.add_argument("-vr", action="store_true", dest="ts_multiplier", default=False,
|
|
69
|
+
help="Add TS_MULTIPLIER input port to control step_size")
|
|
70
|
+
|
|
68
71
|
config = parser.parse_args(command_options)
|
|
69
72
|
|
|
70
73
|
if config.debug:
|
|
@@ -87,7 +90,7 @@ def fmucontainer(command_options: Sequence[str]):
|
|
|
87
90
|
auto_input=config.auto_input, auto_output=config.auto_output,
|
|
88
91
|
auto_local=config.auto_local, mt=config.mt, sequential=config.sequential,
|
|
89
92
|
profiling=config.profiling, fmu_directory=fmu_directory, debug=config.debug,
|
|
90
|
-
auto_parameter=config.auto_parameter)
|
|
93
|
+
auto_parameter=config.auto_parameter, ts_multiplier=config.ts_multiplier)
|
|
91
94
|
except FileNotFoundError as e:
|
|
92
95
|
logger.fatal(f"Cannot read file: {e}")
|
|
93
96
|
sys.exit(-1)
|
|
@@ -9,7 +9,7 @@ from ..operations import (OperationSummary, OperationError, OperationRemoveRegex
|
|
|
9
9
|
OperationStripTopLevel, OperationRenameFromCSV, OperationSaveNamesToCSV, FMU, FMUError)
|
|
10
10
|
from ..remoting import (OperationAddFrontendWin32, OperationAddFrontendWin64, OperationAddRemotingWin32,
|
|
11
11
|
OperationAddRemotingWin64)
|
|
12
|
-
from ..checker import
|
|
12
|
+
from ..checker import get_checkers
|
|
13
13
|
from ..version import __version__ as version
|
|
14
14
|
from ..help import Help
|
|
15
15
|
|
|
@@ -69,7 +69,7 @@ def fmutool(command_options: Sequence[str]):
|
|
|
69
69
|
add_option('-only-locals', action='append_const', dest='apply_on', const='local')
|
|
70
70
|
# Checker
|
|
71
71
|
add_option('-summary', action='append_const', dest='operations_list', const=OperationSummary())
|
|
72
|
-
add_option('-check', action='append_const', dest='operations_list', const=[checker() for checker in
|
|
72
|
+
add_option('-check', action='append_const', dest='operations_list', const=[checker() for checker in get_checkers()])
|
|
73
73
|
|
|
74
74
|
cli_options = parser.parse_args(command_options)
|
|
75
75
|
# handle the "no operation" use case
|
|
@@ -426,7 +426,7 @@ class FMUContainer:
|
|
|
426
426
|
<Category name="fmucontainer"/>
|
|
427
427
|
</LogCategories>
|
|
428
428
|
|
|
429
|
-
<DefaultExperiment stepSize="{step_size}"
|
|
429
|
+
<DefaultExperiment stepSize="{step_size}"{default_experiment_times}/>
|
|
430
430
|
|
|
431
431
|
<ModelVariables>
|
|
432
432
|
<ScalarVariable valueReference="0" name="time" causality="independent"><Real /></ScalarVariable>
|
|
@@ -460,7 +460,7 @@ class FMUContainer:
|
|
|
460
460
|
<Category name="fmucontainer"/>
|
|
461
461
|
</LogCategories>
|
|
462
462
|
|
|
463
|
-
<DefaultExperiment stepSize="{step_size}"
|
|
463
|
+
<DefaultExperiment stepSize="{step_size}"{default_experiment_times}/>
|
|
464
464
|
|
|
465
465
|
<ModelVariables>
|
|
466
466
|
<Float64 valueReference="0" name="time" causality="independent"/>
|
|
@@ -681,7 +681,7 @@ class FMUContainer:
|
|
|
681
681
|
logger.warning(f"{cport} is not connected")
|
|
682
682
|
|
|
683
683
|
def make_fmu(self, fmu_filename: Union[str, Path], step_size: Optional[float] = None, debug=False, mt=False,
|
|
684
|
-
profiling=False, sequential=False):
|
|
684
|
+
profiling=False, sequential=False, ts_multiplier=False):
|
|
685
685
|
if isinstance(fmu_filename, str):
|
|
686
686
|
fmu_filename = Path(fmu_filename)
|
|
687
687
|
|
|
@@ -695,7 +695,7 @@ class FMUContainer:
|
|
|
695
695
|
base_directory = self.fmu_directory / fmu_filename.with_suffix('')
|
|
696
696
|
resources_directory = self.make_fmu_skeleton(base_directory)
|
|
697
697
|
with open(base_directory / "modelDescription.xml", "wt") as xml_file:
|
|
698
|
-
self.make_fmu_xml(xml_file, step_size, profiling)
|
|
698
|
+
self.make_fmu_xml(xml_file, step_size, profiling, ts_multiplier)
|
|
699
699
|
with open(resources_directory / "container.txt", "wt") as txt_file:
|
|
700
700
|
self.make_fmu_txt(txt_file, step_size, mt, profiling, sequential)
|
|
701
701
|
|
|
@@ -703,7 +703,7 @@ class FMUContainer:
|
|
|
703
703
|
if not debug:
|
|
704
704
|
self.make_fmu_cleanup(base_directory)
|
|
705
705
|
|
|
706
|
-
def make_fmu_xml(self, xml_file, step_size: float, profiling: bool):
|
|
706
|
+
def make_fmu_xml(self, xml_file, step_size: float, profiling: bool, ts_multiplier: bool):
|
|
707
707
|
timestamp = datetime.now().strftime('%Y-%m-%dT%H:%M:%SZ')
|
|
708
708
|
guid = str(uuid.uuid4())
|
|
709
709
|
embedded_fmu = ", ".join([fmu_name for fmu_name in self.involved_fmu])
|
|
@@ -732,13 +732,19 @@ class FMUContainer:
|
|
|
732
732
|
else:
|
|
733
733
|
logger.info(f"stop_time={self.stop_time}")
|
|
734
734
|
|
|
735
|
+
default_experiment_times = ""
|
|
736
|
+
if self.start_time is not None:
|
|
737
|
+
default_experiment_times += f' startTime="{self.start_time}"'
|
|
738
|
+
if self.stop_time is not None:
|
|
739
|
+
default_experiment_times += f' stopTime="{self.stop_time}"'
|
|
740
|
+
|
|
735
741
|
if self.fmi_version == 2:
|
|
736
742
|
xml_file.write(self.HEADER_XML_2.format(identifier=self.identifier, tool_version=tool_version,
|
|
737
743
|
timestamp=timestamp, guid=guid, embedded_fmu=embedded_fmu,
|
|
738
744
|
author=author,
|
|
739
745
|
only_once=capabilities['canBeInstantiatedOnlyOncePerProcess'],
|
|
740
746
|
execution_tool=capabilities['needsExecutionTool'],
|
|
741
|
-
|
|
747
|
+
default_experiment_times=default_experiment_times,
|
|
742
748
|
step_size=step_size))
|
|
743
749
|
elif self.fmi_version == 3:
|
|
744
750
|
xml_file.write(self.HEADER_XML_3.format(identifier=self.identifier, tool_version=tool_version,
|
|
@@ -746,12 +752,24 @@ class FMUContainer:
|
|
|
746
752
|
author=author,
|
|
747
753
|
only_once=capabilities['canBeInstantiatedOnlyOncePerProcess'],
|
|
748
754
|
execution_tool=capabilities['needsExecutionTool'],
|
|
749
|
-
|
|
755
|
+
default_experiment_times=default_experiment_times,
|
|
750
756
|
step_size=step_size))
|
|
751
757
|
|
|
752
758
|
vr_time = self.vr_table.add_vr("real64", local=True)
|
|
753
759
|
logger.debug(f"Time vr = {vr_time}")
|
|
754
760
|
|
|
761
|
+
vr_ts_multiplier = self.vr_table.add_vr("integer32", local=True)
|
|
762
|
+
if ts_multiplier:
|
|
763
|
+
logger.debug(f"TS Multiplier vr = {vr_ts_multiplier}")
|
|
764
|
+
port = EmbeddedFMUPort("integer32", {"valueReference": vr_ts_multiplier,
|
|
765
|
+
"name": f"container.ts_multiplier",
|
|
766
|
+
"causality": "input",
|
|
767
|
+
"description": f"Timestep multiplier",
|
|
768
|
+
"variability": "discrete",
|
|
769
|
+
"start": 1,
|
|
770
|
+
"initial": "exact"})
|
|
771
|
+
print(f" {port.xml(vr_ts_multiplier, fmi_version=self.fmi_version)}", file=xml_file)
|
|
772
|
+
|
|
755
773
|
if profiling:
|
|
756
774
|
for fmu in self.involved_fmu.values():
|
|
757
775
|
vr = self.vr_table.add_vr("real64", local=True)
|
|
@@ -915,6 +933,8 @@ class FMUContainer:
|
|
|
915
933
|
if profiling:
|
|
916
934
|
for profiling_port, _ in enumerate(self.involved_fmu.values()):
|
|
917
935
|
print(f"{profiling_port + 1} 1 -2 {profiling_port + 1}", file=txt_file)
|
|
936
|
+
elif type_name == "integer32":
|
|
937
|
+
print(f"0 1 -1 0", file=txt_file) # TS Multiplier
|
|
918
938
|
|
|
919
939
|
for input_port in inputs_per_type[type_name]:
|
|
920
940
|
cport_string = [f"{fmu_rank[cport.fmu.name]} {cport.port.vr}" for cport in input_port.cport_list]
|
{fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/gui.py
RENAMED
|
@@ -16,7 +16,7 @@ from .operations import *
|
|
|
16
16
|
from .remoting import (OperationAddRemotingWin32, OperationAddRemotingWin64, OperationAddFrontendWin32,
|
|
17
17
|
OperationAddFrontendWin64)
|
|
18
18
|
from .assembly import Assembly, AssemblyNode
|
|
19
|
-
from .checker import
|
|
19
|
+
from .checker import get_checkers
|
|
20
20
|
from .help import Help
|
|
21
21
|
from .version import __version__ as version
|
|
22
22
|
|
|
@@ -414,7 +414,7 @@ class MainWindow(WindowWithLayout):
|
|
|
414
414
|
("Add Win64 remoting", '-add-remoting-win64', 'info', OperationAddRemotingWin64),
|
|
415
415
|
("Add Win32 frontend", '-add-frontend-win32', 'info', OperationAddFrontendWin32),
|
|
416
416
|
("Add Win64 frontend", '-add-frontend-win64', 'info', OperationAddFrontendWin64),
|
|
417
|
-
("Check", '-check', 'info',
|
|
417
|
+
("Check", '-check', 'info', get_checkers()),
|
|
418
418
|
]
|
|
419
419
|
|
|
420
420
|
width = 5
|
|
@@ -69,7 +69,13 @@ class FMUPort:
|
|
|
69
69
|
print(f" <{self.fmi_type} {self.dict_level(1)}/>", file=file)
|
|
70
70
|
print(f" </ScalarVariable>", file=file)
|
|
71
71
|
elif fmi_version == 3:
|
|
72
|
-
|
|
72
|
+
start_value = self.get("start", "")
|
|
73
|
+
if self.fmi_type in ("String", "Binary") and start_value:
|
|
74
|
+
print(f" <{self.fmi_type} {self.dict_level(0)}>", file=file)
|
|
75
|
+
print(f' <Start value="{start_value}"/>', file=file)
|
|
76
|
+
print(f" </{self.fmi_type}>", file=file)
|
|
77
|
+
else:
|
|
78
|
+
print(f" <{self.fmi_type} {self.dict_level(0)}/>", file=file)
|
|
73
79
|
else:
|
|
74
80
|
raise FMUError(f"FMUPort writing: unsupported FMI version {fmi_version}")
|
|
75
81
|
|
|
@@ -177,6 +183,8 @@ class Manipulation:
|
|
|
177
183
|
self.current_port = FMUPort()
|
|
178
184
|
self.current_port.fmi_type = name
|
|
179
185
|
self.current_port.push_attrs(attrs)
|
|
186
|
+
elif self.fmu.fmi_version == 3 and name == "Start":
|
|
187
|
+
self.current_port.push_attrs({"start": attrs.get("value", "")})
|
|
180
188
|
elif name == 'CoSimulation':
|
|
181
189
|
self.operation.cosimulation_attrs(attrs)
|
|
182
190
|
elif name == 'DefaultExperiment':
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fmu_manipulation_toolbox
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.9.1
|
|
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
|
|
@@ -190,6 +190,12 @@ class FMUManipulationToolboxTestSuite(unittest.TestCase):
|
|
|
190
190
|
assembly.make_fmu()
|
|
191
191
|
self.assert_simulation("containers/VanDerPol/VanDerPol-Container.fmu", 0.1)
|
|
192
192
|
|
|
193
|
+
def test_container_vanderpol_vr(self):
|
|
194
|
+
assembly = Assembly("VanDerPol-vr.json", fmu_directory=Path("containers/VanDerPol"))
|
|
195
|
+
assembly.make_fmu()
|
|
196
|
+
if os.name == 'nt':
|
|
197
|
+
self.assert_simulation("containers/VanDerPol/VanDerPol-vr2.fmu", 0.1)
|
|
198
|
+
|
|
193
199
|
def test_fmi3_pt2(self):
|
|
194
200
|
assembly = Assembly("passthrough.json", fmu_directory=Path("fmi3/passthrough"), debug=True)
|
|
195
201
|
assembly.make_fmu(fmi_version=2)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'V1.9-rc10'
|
fmu_manipulation_toolbox-1.9rc10/fmu_manipulation_toolbox/resources/darwin64/container.dylib
DELETED
|
Binary file
|
|
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
|
{fmu_manipulation_toolbox-1.9rc10 → fmu_manipulation_toolbox-1.9.1}/fmu_manipulation_toolbox/help.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|