pythonfmu3 0.1.17__py3-none-any.whl → 0.1.18__py3-none-any.whl
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.
- pythonfmu3/_version.py +1 -1
- pythonfmu3/builder.py +15 -13
- pythonfmu3/resources/binaries/x86_64-windows/pythonfmu-export.dll +0 -0
- pythonfmu3/tests/test_builder.py +4 -7
- {pythonfmu3-0.1.17.dist-info → pythonfmu3-0.1.18.dist-info}/METADATA +4 -4
- {pythonfmu3-0.1.17.dist-info → pythonfmu3-0.1.18.dist-info}/RECORD +10 -10
- {pythonfmu3-0.1.17.dist-info → pythonfmu3-0.1.18.dist-info}/LICENSE +0 -0
- {pythonfmu3-0.1.17.dist-info → pythonfmu3-0.1.18.dist-info}/WHEEL +0 -0
- {pythonfmu3-0.1.17.dist-info → pythonfmu3-0.1.18.dist-info}/entry_points.txt +0 -0
- {pythonfmu3-0.1.17.dist-info → pythonfmu3-0.1.18.dist-info}/top_level.txt +0 -0
pythonfmu3/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.18"
|
pythonfmu3/builder.py
CHANGED
|
@@ -66,7 +66,7 @@ class FmuBuilder:
|
|
|
66
66
|
dest: FilePath = ".",
|
|
67
67
|
project_files: Iterable[FilePath] = set(),
|
|
68
68
|
documentation_folder: Optional[FilePath] = None,
|
|
69
|
-
|
|
69
|
+
terminals : Optional[FilePath] = None,
|
|
70
70
|
**options,
|
|
71
71
|
) -> Path:
|
|
72
72
|
script_file = Path(script_file)
|
|
@@ -87,11 +87,15 @@ class FmuBuilder:
|
|
|
87
87
|
f"The documentation folder does not exists {documentation_folder!s}"
|
|
88
88
|
)
|
|
89
89
|
|
|
90
|
-
if
|
|
91
|
-
|
|
92
|
-
if not
|
|
90
|
+
if terminals is not None:
|
|
91
|
+
terminals = Path(terminals)
|
|
92
|
+
if not terminals.exists():
|
|
93
93
|
raise ValueError(
|
|
94
|
-
f"The
|
|
94
|
+
f"The specified terminalsAndIcons file does not exists {terminals!s}"
|
|
95
|
+
)
|
|
96
|
+
if not terminals.name == "terminalsAndIcons.xml":
|
|
97
|
+
raise ValueError(
|
|
98
|
+
f"Incorrect terminal name {terminals!s}. Terminal file must be named terminalsAndIcons.xml"
|
|
95
99
|
)
|
|
96
100
|
|
|
97
101
|
module_name = script_file.stem
|
|
@@ -186,12 +190,10 @@ class FmuBuilder:
|
|
|
186
190
|
relative_f = f.relative_to(documentation_folder)
|
|
187
191
|
zip_fmu.write(f, arcname=(documentation / relative_f))
|
|
188
192
|
|
|
189
|
-
if
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
relative_f = f.relative_to(terminals_folder)
|
|
194
|
-
zip_fmu.write(f, arcname=(terminals / relative_f))
|
|
193
|
+
if terminals is not None:
|
|
194
|
+
terminalsFolder = Path("terminalsAndIcons")
|
|
195
|
+
relative_f = terminals.relative_to(terminals.parent)
|
|
196
|
+
zip_fmu.write(f, arcname=(terminalsFolder / relative_f))
|
|
195
197
|
|
|
196
198
|
|
|
197
199
|
# Add the model description
|
|
@@ -233,8 +235,8 @@ def create_command_parser(parser: argparse.ArgumentParser):
|
|
|
233
235
|
|
|
234
236
|
parser.add_argument(
|
|
235
237
|
"--terminals",
|
|
236
|
-
dest="
|
|
237
|
-
help="
|
|
238
|
+
dest="terminals",
|
|
239
|
+
help="Terminals file (terminalsAndIcons.xml) to include in the FMU.",
|
|
238
240
|
default=None
|
|
239
241
|
)
|
|
240
242
|
|
|
Binary file
|
pythonfmu3/tests/test_builder.py
CHANGED
|
@@ -183,16 +183,13 @@ def test_terminals(tmp_path):
|
|
|
183
183
|
def build():
|
|
184
184
|
with tempfile.TemporaryDirectory() as terminals_dir:
|
|
185
185
|
terminals_dir = Path(terminals_dir)
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
terminals = terminals_dir / "terminalsAndIcons.xml"
|
|
187
|
+
terminals.write_text("Dummy Terminal 1")
|
|
188
188
|
|
|
189
|
-
|
|
190
|
-
terminal2.write_text("Dummy Terminal 2")
|
|
191
|
-
return FmuBuilder.build_FMU(script_file, dest=tmp_path, terminals_folder=terminals_dir)
|
|
189
|
+
return FmuBuilder.build_FMU(script_file, dest=tmp_path, terminals=terminals)
|
|
192
190
|
|
|
193
191
|
fmu = build()
|
|
194
192
|
with zipfile.ZipFile(fmu) as files:
|
|
195
193
|
names = files.namelist()
|
|
196
194
|
|
|
197
|
-
assert "terminalsAndIcons/
|
|
198
|
-
assert "terminalsAndIcons/terminal2.xml" in names
|
|
195
|
+
assert "terminalsAndIcons/terminalsAndIcons.xml" in names
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: pythonfmu3
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.18
|
|
4
4
|
Summary: A lightweight framework that enables the packaging of Python3.x code as co-simulation FMUs.
|
|
5
5
|
Home-page: https://github.com/stephensmith25/PythonFMU3
|
|
6
6
|
Author: Stephen Smith
|
|
@@ -62,7 +62,7 @@ pip install pythonfmu3
|
|
|
62
62
|
3. Run `pythonfmu3 build` to create the fmu.
|
|
63
63
|
|
|
64
64
|
```
|
|
65
|
-
usage: pythonfmu3 build [-h] -f SCRIPT_FILE [-d DEST] [--doc DOCUMENTATION_FOLDER] [--terminals
|
|
65
|
+
usage: pythonfmu3 build [-h] -f SCRIPT_FILE [-d DEST] [--doc DOCUMENTATION_FOLDER] [--terminals TERMINALS_FILE] [--no-external-tool]
|
|
66
66
|
[--no-variable-step] [--interpolate-inputs] [--only-one-per-process] [--handle-state]
|
|
67
67
|
[--serialize-state] [--use-memory-management]
|
|
68
68
|
[Project files [Project files ...]]
|
|
@@ -79,8 +79,8 @@ optional arguments:
|
|
|
79
79
|
-d DEST, --dest DEST Where to save the FMU.
|
|
80
80
|
--doc DOCUMENTATION_FOLDER
|
|
81
81
|
Documentation folder to include in the FMU.
|
|
82
|
-
--terminals
|
|
83
|
-
|
|
82
|
+
--terminals TERMINALS_FILE
|
|
83
|
+
Terminals file (terminalsAndIcons.xml) to include in the FMU.
|
|
84
84
|
--no-external-tool If given, needsExecutionTool=false
|
|
85
85
|
--no-variable-step If given, canHandleVariableCommunicationStepSize=false
|
|
86
86
|
--interpolate-inputs If given, canInterpolateInputs=true
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
pythonfmu3/__init__.py,sha256=oN-2oXyCFwq0gvL2IEf5QvwIXBXZgsSBwAJw7LZ9vzc,424
|
|
2
2
|
pythonfmu3/__main__.py,sha256=gC1T8x2d02hhqshyNQGSS70SyCk-3I3t8zPqoRo2Xd8,1543
|
|
3
|
-
pythonfmu3/_version.py,sha256=
|
|
4
|
-
pythonfmu3/builder.py,sha256=
|
|
3
|
+
pythonfmu3/_version.py,sha256=6BiuMUkhwQp6bzUZSF8np8F1NwCltEtK0sPBF__tepU,23
|
|
4
|
+
pythonfmu3/builder.py,sha256=d_nTRWKohZrZsMbTmxiYJzszzVBp-CRisV_y_OVyW6U,9779
|
|
5
5
|
pythonfmu3/default_experiment.py,sha256=FJ0l0FpU7pT4Pox2RiA2y-Cb_e7DE2XlbWKySRYQaVk,293
|
|
6
6
|
pythonfmu3/deploy.py,sha256=eqFWVxZUkJCLvmq1-GuMNjn2j0VCGoaXPhRWrCk2Vxg,3741
|
|
7
7
|
pythonfmu3/enums.py,sha256=ZmC6vGeBTGt7HarPQ4uYV10ezPsvIxAHH1ypjNq7G3E,729
|
|
@@ -28,10 +28,10 @@ pythonfmu3/pythonfmu-export/src/pythonfmu/PySlaveInstance.cpp,sha256=MpEUUcxPwoJ
|
|
|
28
28
|
pythonfmu3/pythonfmu-export/src/pythonfmu/PySlaveInstance.hpp,sha256=T-epGp68SjhDv-JupxUe2ZgnV8unU4htc-PUBokjWm4,4239
|
|
29
29
|
pythonfmu3/pythonfmu-export/src/pythonfmu/PyState.hpp,sha256=CjFEIrZu8b1jxQAIgfI_o36hyItW_SdQ5VSkImf7JNs,2977
|
|
30
30
|
pythonfmu3/resources/binaries/x86_64-linux/libpythonfmu-export.so,sha256=LLTlb6TDjJ24xuy7zhO5Sbj39nVzQSODkkXMXGl8Y7s,365224
|
|
31
|
-
pythonfmu3/resources/binaries/x86_64-windows/pythonfmu-export.dll,sha256=
|
|
31
|
+
pythonfmu3/resources/binaries/x86_64-windows/pythonfmu-export.dll,sha256=wi2jjGlTgRz5Gi8YNZsi4xoEzrxKO4UE7xVT0nBZViY,430592
|
|
32
32
|
pythonfmu3/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
33
|
pythonfmu3/tests/conftest.py,sha256=B6XxTnBdeF_tEJ3w2DlfPKUfvlk-oULgIhQtXkgOJIc,171
|
|
34
|
-
pythonfmu3/tests/test_builder.py,sha256=
|
|
34
|
+
pythonfmu3/tests/test_builder.py,sha256=GrD4ziin3RLOe_36rBQCMnKrSkhc3IqnxE1a6kCFPok,6842
|
|
35
35
|
pythonfmu3/tests/test_deploy.py,sha256=JCDo-O93-izxrP9Q4K0njBcfZ-gAXYx9aZ4plgctz7k,1783
|
|
36
36
|
pythonfmu3/tests/test_fmi3slave.py,sha256=1uwTdfiFZNmU0yzIdC30kAuu95xsZSTMA9CGk_Kdmm4,4304
|
|
37
37
|
pythonfmu3/tests/test_integration.py,sha256=zA3iJ4rI2cKEE8mDsAmcVuwNWlJzhonV8Wxz92hzEac,10387
|
|
@@ -46,9 +46,9 @@ pythonfmu3/tests/slaves/localmodule.py,sha256=-q5Lmh2I88MG7nLTscms0n5xhHLkUDed1I
|
|
|
46
46
|
pythonfmu3/tests/slaves/pythonslave.py,sha256=uzrTQmfk0QBalxNTviGMZNph_YgVmcbxPqKgX5rSvXg,2172
|
|
47
47
|
pythonfmu3/tests/slaves/pythonslave_read_file.py,sha256=t2sDaZSr2veD91gdqCO9W9CN-AN3TyXABXXfV9Rt0Xs,791
|
|
48
48
|
pythonfmu3/tests/slaves/slavewithdep.py,sha256=hHDFB0dw8wkHiGzxeAVbz9O5LR6ghsFeONgRFdiK_t0,812
|
|
49
|
-
pythonfmu3-0.1.
|
|
50
|
-
pythonfmu3-0.1.
|
|
51
|
-
pythonfmu3-0.1.
|
|
52
|
-
pythonfmu3-0.1.
|
|
53
|
-
pythonfmu3-0.1.
|
|
54
|
-
pythonfmu3-0.1.
|
|
49
|
+
pythonfmu3-0.1.18.dist-info/LICENSE,sha256=24Cw_MPouLK-G_t8Hgjm59IS9BnPoL6SKkyuZ0xesXY,1155
|
|
50
|
+
pythonfmu3-0.1.18.dist-info/METADATA,sha256=FKgLxqU6YXlmXZaZSKkQVd7zxxMP-Dz86QJND8BehKA,7586
|
|
51
|
+
pythonfmu3-0.1.18.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
52
|
+
pythonfmu3-0.1.18.dist-info/entry_points.txt,sha256=GgkWYs0DKGHLcijMEYZGkhkHOK2RVUpjGwvl1fwyDwQ,60
|
|
53
|
+
pythonfmu3-0.1.18.dist-info/top_level.txt,sha256=6ne7bh_cME1hepxCx1BG8N5QVhVAufrp7LLok6vq7nE,11
|
|
54
|
+
pythonfmu3-0.1.18.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|