fmu-manipulation-toolbox 1.9rc7__tar.gz → 1.9rc8__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.9rc7 → fmu_manipulation_toolbox-1.9rc8}/PKG-INFO +1 -1
- fmu_manipulation_toolbox-1.9rc8/fmu_manipulation_toolbox/__version__.py +1 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/cli/fmucontainer.py +8 -6
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/cli/fmusplit.py +8 -5
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/cli/fmutool.py +5 -3
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/operations.py +10 -6
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/darwin64/container.dylib +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/linux32/client_sm.so +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/linux64/client_sm.so +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/linux64/container.so +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/win32/client_sm.dll +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/win32/server_sm.exe +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/win64/client_sm.dll +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/win64/container.dll +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/win64/server_sm.exe +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/split.py +8 -3
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox.egg-info/PKG-INFO +1 -1
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/tests/test_suite.py +25 -1
- fmu_manipulation_toolbox-1.9rc7/fmu_manipulation_toolbox/__version__.py +0 -1
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/LICENSE.txt +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/README.md +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/__init__.py +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/__main__.py +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/assembly.py +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/checker.py +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/cli/__init__.py +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/cli/utils.py +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/container.py +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/gui.py +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/gui_style.py +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/help.py +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/remoting.py +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/checkbox-checked-disabled.png +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/checkbox-checked-hover.png +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/checkbox-checked.png +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/checkbox-unchecked-disabled.png +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/checkbox-unchecked-hover.png +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/checkbox-unchecked.png +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/container.png +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/drop_fmu.png +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2Annotation.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2AttributeGroups.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2ModelDescription.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2ScalarVariable.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2Type.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2Unit.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-2.0/fmi2VariableDependency.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Annotation.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3AttributeGroups.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3BuildDescription.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3InterfaceType.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3LayeredStandardManifest.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3ModelDescription.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Terminal.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3TerminalsAndIcons.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Type.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Unit.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3Variable.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmi-3.0/fmi3VariableDependency.xsd +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmu.png +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/fmu_manipulation_toolbox.png +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/help.png +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/icon-round.png +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/icon.png +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/icon_fmu.png +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/license.txt +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/linux32/server_sm +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/linux64/server_sm +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/mask.png +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/resources/model.png +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/version.py +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox.egg-info/SOURCES.txt +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox.egg-info/dependency_links.txt +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox.egg-info/entry_points.txt +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox.egg-info/requires.txt +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox.egg-info/top_level.txt +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/setup.cfg +0 -0
- {fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/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.9rc8
|
|
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-rc8'
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
import logging
|
|
3
|
+
import sys
|
|
3
4
|
|
|
5
|
+
from typing import *
|
|
4
6
|
from pathlib import Path
|
|
5
7
|
|
|
6
8
|
from .utils import setup_logger, make_wide
|
|
@@ -9,7 +11,7 @@ from ..container import FMUContainerError
|
|
|
9
11
|
from ..version import __version__ as version
|
|
10
12
|
|
|
11
13
|
|
|
12
|
-
def fmucontainer():
|
|
14
|
+
def fmucontainer(command_options: Sequence[str]):
|
|
13
15
|
logger = setup_logger()
|
|
14
16
|
|
|
15
17
|
logger.info(f"FMUContainer version {version}")
|
|
@@ -63,7 +65,7 @@ def fmucontainer():
|
|
|
63
65
|
parser.add_argument("-dump-json", action="store_true", dest="dump", default=False,
|
|
64
66
|
help="Dump a JSON file for each container.")
|
|
65
67
|
|
|
66
|
-
config = parser.parse_args()
|
|
68
|
+
config = parser.parse_args(command_options)
|
|
67
69
|
|
|
68
70
|
if config.debug:
|
|
69
71
|
logger.setLevel(logging.DEBUG)
|
|
@@ -88,16 +90,16 @@ def fmucontainer():
|
|
|
88
90
|
auto_parameter=config.auto_parameter)
|
|
89
91
|
except FileNotFoundError as e:
|
|
90
92
|
logger.fatal(f"Cannot read file: {e}")
|
|
91
|
-
|
|
93
|
+
sys.exit(-1)
|
|
92
94
|
except (FMUContainerError, AssemblyError) as e:
|
|
93
95
|
logger.fatal(f"{filename}: {e}")
|
|
94
|
-
|
|
96
|
+
sys.exit(-2)
|
|
95
97
|
|
|
96
98
|
try:
|
|
97
99
|
assembly.make_fmu(dump_json=config.dump, fmi_version=int(config.fmi_version))
|
|
98
100
|
except FMUContainerError as e:
|
|
99
101
|
logger.fatal(f"{filename}: {e}")
|
|
100
|
-
|
|
102
|
+
sys.exit(-3)
|
|
101
103
|
|
|
102
104
|
if __name__ == "__main__":
|
|
103
|
-
fmucontainer()
|
|
105
|
+
fmucontainer(sys.argv[1:])
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
import logging
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
from typing import *
|
|
3
6
|
|
|
4
7
|
from .utils import setup_logger, make_wide
|
|
5
8
|
from ..split import FMUSplitter, FMUSplitterError
|
|
6
9
|
from ..version import __version__ as version
|
|
7
10
|
|
|
8
11
|
|
|
9
|
-
def fmusplit():
|
|
12
|
+
def fmusplit(command_options: Sequence[str]):
|
|
10
13
|
logger = setup_logger()
|
|
11
14
|
|
|
12
15
|
logger.info(f"FMUSplit version {version}")
|
|
@@ -24,7 +27,7 @@ def fmusplit():
|
|
|
24
27
|
metavar="filename.fmu", required=True,
|
|
25
28
|
help="Description of the FMU container to split.")
|
|
26
29
|
|
|
27
|
-
config = parser.parse_args()
|
|
30
|
+
config = parser.parse_args(command_options)
|
|
28
31
|
|
|
29
32
|
if config.debug:
|
|
30
33
|
logger.setLevel(logging.DEBUG)
|
|
@@ -35,11 +38,11 @@ def fmusplit():
|
|
|
35
38
|
splitter.split_fmu()
|
|
36
39
|
except FMUSplitterError as e:
|
|
37
40
|
logger.fatal(f"{fmu_filename}: {e}")
|
|
38
|
-
|
|
41
|
+
sys.exit(-1)
|
|
39
42
|
except FileNotFoundError as e:
|
|
40
43
|
logger.fatal(f"Cannot read file: {e}")
|
|
41
|
-
|
|
44
|
+
sys.exit(-2)
|
|
42
45
|
|
|
43
46
|
|
|
44
47
|
if __name__ == "__main__":
|
|
45
|
-
fmusplit()
|
|
48
|
+
fmusplit(sys.argv[1:])
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
import sys
|
|
3
3
|
|
|
4
|
+
from typing import *
|
|
5
|
+
|
|
4
6
|
from .utils import setup_logger, make_wide
|
|
5
7
|
from ..operations import (OperationSummary, OperationError, OperationRemoveRegexp,
|
|
6
8
|
OperationRemoveSources, OperationTrimUntil, OperationKeepOnlyRegexp, OperationMergeTopLevel,
|
|
@@ -12,7 +14,7 @@ from ..version import __version__ as version
|
|
|
12
14
|
from ..help import Help
|
|
13
15
|
|
|
14
16
|
|
|
15
|
-
def fmutool():
|
|
17
|
+
def fmutool(command_options: Sequence[str]):
|
|
16
18
|
logger = setup_logger()
|
|
17
19
|
|
|
18
20
|
logger.info(f"FMU Manipulation Toolbox version {version}")
|
|
@@ -68,7 +70,7 @@ def fmutool():
|
|
|
68
70
|
add_option('-summary', action='append_const', dest='operations_list', const=OperationSummary())
|
|
69
71
|
add_option('-check', action='append_const', dest='operations_list', const=[checker() for checker in checker_list])
|
|
70
72
|
|
|
71
|
-
cli_options = parser.parse_args()
|
|
73
|
+
cli_options = parser.parse_args(command_options)
|
|
72
74
|
# handle the "no operation" use case
|
|
73
75
|
if not cli_options.operations_list:
|
|
74
76
|
cli_options.operations_list = []
|
|
@@ -121,4 +123,4 @@ def fmutool():
|
|
|
121
123
|
logger.info(f"INFO Modified FMU is not saved. If necessary use '-output' option.")
|
|
122
124
|
|
|
123
125
|
if __name__ == "__main__":
|
|
124
|
-
fmutool()
|
|
126
|
+
fmutool(sys.argv[1:])
|
|
@@ -416,8 +416,8 @@ class OperationSummary(OperationAbstract):
|
|
|
416
416
|
hash_md5.update(chunk)
|
|
417
417
|
digest = hash_md5.hexdigest()
|
|
418
418
|
logger.info(f"| MD5Sum = {digest}")
|
|
419
|
-
|
|
420
|
-
logger.info(f"
|
|
419
|
+
logger.info(f"|")
|
|
420
|
+
logger.info(f"| FMI properties: ")
|
|
421
421
|
for (k, v) in attrs.items():
|
|
422
422
|
logger.info(f"| - {k} = {v}")
|
|
423
423
|
logger.info(f"|")
|
|
@@ -457,21 +457,25 @@ class OperationSummary(OperationAbstract):
|
|
|
457
457
|
|
|
458
458
|
resource_dir = os.path.join(self.fmu.tmp_directory, "resources")
|
|
459
459
|
if os.path.isdir(resource_dir):
|
|
460
|
-
logger.info("
|
|
460
|
+
logger.info("|")
|
|
461
|
+
logger.info("| Embedded resources:")
|
|
461
462
|
for resource in os.listdir(resource_dir):
|
|
462
463
|
logger.info(f"| - {resource}")
|
|
463
464
|
|
|
464
465
|
extra_dir = os.path.join(self.fmu.tmp_directory, "extra")
|
|
465
466
|
if os.path.isdir(extra_dir):
|
|
466
|
-
logger.info("
|
|
467
|
+
logger.info("|")
|
|
468
|
+
logger.info("| Additional (meta-)data:")
|
|
467
469
|
for extra in os.listdir(extra_dir):
|
|
468
470
|
logger.info(f"| - {extra}")
|
|
469
471
|
|
|
470
|
-
logger.info("
|
|
472
|
+
logger.info("|")
|
|
473
|
+
logger.info("| Number of ports")
|
|
471
474
|
for causality, nb_ports in self.nb_port_per_causality.items():
|
|
472
475
|
logger.info(f"| {causality} : {nb_ports}")
|
|
473
476
|
|
|
474
|
-
logger.info("
|
|
477
|
+
logger.info("|")
|
|
478
|
+
logger.info("| [End of report]")
|
|
475
479
|
|
|
476
480
|
|
|
477
481
|
class OperationRemoveSources(OperationAbstract):
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -6,6 +6,8 @@ import xml.parsers.expat
|
|
|
6
6
|
from typing import *
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
|
|
9
|
+
from .container import EmbeddedFMUPort
|
|
10
|
+
|
|
9
11
|
logger = logging.getLogger("fmu_manipulation_toolbox")
|
|
10
12
|
|
|
11
13
|
|
|
@@ -66,7 +68,7 @@ class FMUSplitter:
|
|
|
66
68
|
def split_fmu(self):
|
|
67
69
|
logger.info(f"Splitting...")
|
|
68
70
|
config = self._split_fmu(fmu_filename=str(self.fmu_filename), relative_path="")
|
|
69
|
-
config_filename = self.directory / self.fmu_filename.with_suffix(".json")
|
|
71
|
+
config_filename = self.directory / self.fmu_filename.with_suffix(".json").name
|
|
70
72
|
with open(config_filename, "w") as file:
|
|
71
73
|
json.dump(config, file, indent=2)
|
|
72
74
|
logger.info(f"Container definition saved to '{config_filename}'")
|
|
@@ -77,7 +79,7 @@ class FMUSplitter:
|
|
|
77
79
|
if txt_filename in self.filenames_list:
|
|
78
80
|
description = FMUSplitterDescription(self.zip)
|
|
79
81
|
config = description.parse_txt_file(txt_filename)
|
|
80
|
-
config["name"] = fmu_filename
|
|
82
|
+
config["name"] = Path(fmu_filename).name
|
|
81
83
|
for i, fmu_filename in enumerate(config["candidate_fmu"]):
|
|
82
84
|
directory = f"{relative_path}resources/{i:02x}/"
|
|
83
85
|
if directory not in self.dir_set:
|
|
@@ -134,6 +136,7 @@ class FMUSplitterDescription:
|
|
|
134
136
|
self.current_vr = None
|
|
135
137
|
self.current_name = None
|
|
136
138
|
self.current_causality = None
|
|
139
|
+
self.supported_fmi_types: Tuple[str] = ()
|
|
137
140
|
|
|
138
141
|
@staticmethod
|
|
139
142
|
def get_line(file):
|
|
@@ -182,10 +185,12 @@ class FMUSplitterDescription:
|
|
|
182
185
|
def parse_txt_file_header(self, file, txt_filename):
|
|
183
186
|
flags = self.get_line(file).split(" ")
|
|
184
187
|
if len(flags) == 1:
|
|
188
|
+
self.supported_fmi_types = ("Real", "Integer", "Boolean", "String")
|
|
185
189
|
self.config["mt"] = flags[0] == "1"
|
|
186
190
|
self.config["profiling"] = self.get_line(file) == "1"
|
|
187
191
|
self.config["sequential"] = False
|
|
188
192
|
elif len(flags) == 3:
|
|
193
|
+
self.supported_fmi_types = EmbeddedFMUPort.ALL_TYPES
|
|
189
194
|
self.config["mt"] = flags[0] == "1"
|
|
190
195
|
self.config["profiling"] = flags[1] == "1"
|
|
191
196
|
self.config["sequential"] = flags[2] == "1"
|
|
@@ -242,7 +247,7 @@ class FMUSplitterDescription:
|
|
|
242
247
|
logger.debug(f"Adding container port {causality}: {definition}")
|
|
243
248
|
|
|
244
249
|
def parse_txt_file_ports(self, file):
|
|
245
|
-
for fmi_type in
|
|
250
|
+
for fmi_type in self.supported_fmi_types:
|
|
246
251
|
nb_port_variables = self.get_line(file).split(" ")[0]
|
|
247
252
|
for i in range(int(nb_port_variables)):
|
|
248
253
|
tokens = self.get_line(file).split(" ")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fmu_manipulation_toolbox
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.9rc8
|
|
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
|
|
@@ -9,7 +9,9 @@ from fmu_manipulation_toolbox.operations import *
|
|
|
9
9
|
from fmu_manipulation_toolbox.remoting import *
|
|
10
10
|
from fmu_manipulation_toolbox.container import *
|
|
11
11
|
from fmu_manipulation_toolbox.assembly import *
|
|
12
|
-
|
|
12
|
+
from fmu_manipulation_toolbox.cli.fmutool import fmutool
|
|
13
|
+
from fmu_manipulation_toolbox.cli.fmusplit import fmusplit
|
|
14
|
+
from fmu_manipulation_toolbox.cli.fmucontainer import fmucontainer
|
|
13
15
|
|
|
14
16
|
class FMUManipulationToolboxTestSuite(unittest.TestCase):
|
|
15
17
|
def __init__(self, *args, **kwargs):
|
|
@@ -214,6 +216,28 @@ class FMUManipulationToolboxTestSuite(unittest.TestCase):
|
|
|
214
216
|
for link in links_fmu0a:
|
|
215
217
|
print(f"{link}")
|
|
216
218
|
|
|
219
|
+
def test_fmutool(self):
|
|
220
|
+
fmutool(['-input', 'operations/bouncing_ball.fmu', '-summary', '-check', '-dump-csv',
|
|
221
|
+
'operations/cli-bouncing_ball.csv'])
|
|
222
|
+
self.assert_identical_files("operations/cli-bouncing_ball.csv", "operations/REF-bouncing_ball.csv")
|
|
223
|
+
|
|
224
|
+
def test_fmucontainer_csv(self):
|
|
225
|
+
fmucontainer(['-container', 'cli-bouncing.csv', '-fmu-directory', 'containers/bouncing_ball', '-mt', '-debug'])
|
|
226
|
+
self.assert_identical_files("containers/bouncing_ball/REF-container.txt",
|
|
227
|
+
"containers/bouncing_ball/cli-bouncing/resources/container.txt")
|
|
228
|
+
|
|
229
|
+
def test_fmucontainer_json(self):
|
|
230
|
+
fmucontainer(['-fmu-directory', 'containers/arch', '-container', 'cli-flat.json', '-dump'])
|
|
231
|
+
self.assert_identical_files("containers/arch/REF-cli-flat-dump.json",
|
|
232
|
+
"containers/arch/cli-flat-dump.json")
|
|
233
|
+
|
|
234
|
+
def test_fmusplit(self):
|
|
235
|
+
fmusplit(["-fmu", "containers/ssp/bouncing.fmu"])
|
|
236
|
+
self.assertTrue(Path("containers/ssp/bouncing.dir/bb_position.fmu").exists())
|
|
237
|
+
self.assertTrue(Path("containers/ssp/bouncing.dir/bb_velocity.fmu").exists())
|
|
238
|
+
self.assert_identical_files("containers/ssp/REF-split-bouncing.json",
|
|
239
|
+
"containers/ssp/bouncing.dir/bouncing.json")
|
|
240
|
+
|
|
217
241
|
|
|
218
242
|
if __name__ == '__main__':
|
|
219
243
|
unittest.main()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'V1.9-rc7'
|
|
File without changes
|
|
File without changes
|
|
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.9rc7 → fmu_manipulation_toolbox-1.9rc8}/fmu_manipulation_toolbox/gui.py
RENAMED
|
File without changes
|
|
File without changes
|
{fmu_manipulation_toolbox-1.9rc7 → fmu_manipulation_toolbox-1.9rc8}/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
|