pythonfmu3 0.1.17__tar.gz → 0.2.0__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.
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/LICENSE +1 -0
- {pythonfmu3-0.1.17/pythonfmu3.egg-info → pythonfmu3-0.2.0}/PKG-INFO +4 -4
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/README.md +3 -3
- pythonfmu3-0.2.0/pythonfmu3/_version.py +1 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/builder.py +15 -13
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/CMakeLists.txt +5 -4
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/resources/binaries/x86_64-linux/libpythonfmu-export.so +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/resources/binaries/x86_64-windows/pythonfmu-export.dll +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/tests/test_builder.py +4 -7
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0/pythonfmu3.egg-info}/PKG-INFO +4 -4
- pythonfmu3-0.1.17/pythonfmu3/_version.py +0 -1
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/MANIFEST.in +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/__init__.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/__main__.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/default_experiment.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/deploy.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/enums.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/fmi3slave.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/logmsg.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/osutil.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/.clang-format +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/CMakeLists.txt +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/build_unix.sh +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/build_win.sh +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/cppfmu/cppfmu_common.hpp +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/cppfmu/cppfmu_cs.cpp +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/cppfmu/cppfmu_cs.hpp +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/cppfmu/fmi_functions.cpp +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/fmi/fmi3FunctionTypes.h +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/fmi/fmi3Functions.h +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/fmi/fmi3PlatformTypes.h +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/pythonfmu/IPyState.hpp +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/pythonfmu/PySlaveInstance.cpp +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/pythonfmu/PySlaveInstance.hpp +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/pythonfmu/PyState.hpp +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/tests/__init__.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/tests/conftest.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/tests/data/csvdemo.csv +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/tests/data/hello.txt +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/tests/slaves/PythonSlaveWithException.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/tests/slaves/localmodule.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/tests/slaves/pythonslave.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/tests/slaves/pythonslave_read_file.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/tests/slaves/slavewithdep.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/tests/test_deploy.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/tests/test_fmi3slave.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/tests/test_integration.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/tests/test_logger.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/tests/test_multiple_fmus.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/tests/test_variables.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/tests/utils.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/unit.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/variable_types.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/variables.py +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3.egg-info/SOURCES.txt +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3.egg-info/dependency_links.txt +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3.egg-info/entry_points.txt +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3.egg-info/not-zip-safe +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3.egg-info/requires.txt +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3.egg-info/top_level.txt +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/setup.cfg +0 -0
- {pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/setup.py +0 -0
|
@@ -2,6 +2,7 @@ MIT License
|
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2019-2020 NTNU - Department of Ocean Operations and Civil Engineering
|
|
4
4
|
Copyright (c) 2019-2020 Safran SA
|
|
5
|
+
Copyright (c) 2023 Stephen Smith
|
|
5
6
|
|
|
6
7
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
8
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: pythonfmu3
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
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
|
|
@@ -36,7 +36,7 @@ pip install pythonfmu3
|
|
|
36
36
|
3. Run `pythonfmu3 build` to create the fmu.
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
usage: pythonfmu3 build [-h] -f SCRIPT_FILE [-d DEST] [--doc DOCUMENTATION_FOLDER] [--terminals
|
|
39
|
+
usage: pythonfmu3 build [-h] -f SCRIPT_FILE [-d DEST] [--doc DOCUMENTATION_FOLDER] [--terminals TERMINALS_FILE] [--no-external-tool]
|
|
40
40
|
[--no-variable-step] [--interpolate-inputs] [--only-one-per-process] [--handle-state]
|
|
41
41
|
[--serialize-state] [--use-memory-management]
|
|
42
42
|
[Project files [Project files ...]]
|
|
@@ -53,8 +53,8 @@ optional arguments:
|
|
|
53
53
|
-d DEST, --dest DEST Where to save the FMU.
|
|
54
54
|
--doc DOCUMENTATION_FOLDER
|
|
55
55
|
Documentation folder to include in the FMU.
|
|
56
|
-
--terminals
|
|
57
|
-
|
|
56
|
+
--terminals TERMINALS_FILE
|
|
57
|
+
Terminals file (terminalsAndIcons.xml) to include in the FMU.
|
|
58
58
|
--no-external-tool If given, needsExecutionTool=false
|
|
59
59
|
--no-variable-step If given, canHandleVariableCommunicationStepSize=false
|
|
60
60
|
--interpolate-inputs If given, canInterpolateInputs=true
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.0"
|
|
@@ -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
|
|
|
@@ -26,10 +26,11 @@ target_include_directories(pythonfmu-export
|
|
|
26
26
|
"${CMAKE_CURRENT_SOURCE_DIR}"
|
|
27
27
|
)
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
if (WIN32)
|
|
30
|
+
target_link_libraries(pythonfmu-export PRIVATE ${Python3_LIBRARIES})
|
|
31
|
+
elseif (APPLE)
|
|
32
|
+
set_target_properties(pythonfmu-export PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
|
|
33
|
+
endif ()
|
|
33
34
|
|
|
34
35
|
if (WIN32)
|
|
35
36
|
set_target_properties(pythonfmu-export
|
|
Binary file
|
|
Binary file
|
|
@@ -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.
|
|
3
|
+
Version: 0.2.0
|
|
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 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.17"
|
|
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
|
{pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/cppfmu/cppfmu_common.hpp
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/cppfmu/fmi_functions.cpp
RENAMED
|
File without changes
|
{pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/fmi/fmi3FunctionTypes.h
RENAMED
|
File without changes
|
|
File without changes
|
{pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/fmi/fmi3PlatformTypes.h
RENAMED
|
File without changes
|
{pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/pythonfmu/IPyState.hpp
RENAMED
|
File without changes
|
{pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/pythonfmu/PySlaveInstance.cpp
RENAMED
|
File without changes
|
{pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/pythonfmu/PySlaveInstance.hpp
RENAMED
|
File without changes
|
{pythonfmu3-0.1.17 → pythonfmu3-0.2.0}/pythonfmu3/pythonfmu-export/src/pythonfmu/PyState.hpp
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
|