pythonfmu3 0.1.17__tar.gz → 0.1.18__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.
Files changed (62) hide show
  1. {pythonfmu3-0.1.17/pythonfmu3.egg-info → pythonfmu3-0.1.18}/PKG-INFO +4 -4
  2. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/README.md +3 -3
  3. pythonfmu3-0.1.18/pythonfmu3/_version.py +1 -0
  4. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/builder.py +15 -13
  5. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/resources/binaries/x86_64-windows/pythonfmu-export.dll +0 -0
  6. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/tests/test_builder.py +4 -7
  7. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18/pythonfmu3.egg-info}/PKG-INFO +4 -4
  8. pythonfmu3-0.1.17/pythonfmu3/_version.py +0 -1
  9. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/LICENSE +0 -0
  10. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/MANIFEST.in +0 -0
  11. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/__init__.py +0 -0
  12. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/__main__.py +0 -0
  13. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/default_experiment.py +0 -0
  14. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/deploy.py +0 -0
  15. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/enums.py +0 -0
  16. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/fmi3slave.py +0 -0
  17. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/logmsg.py +0 -0
  18. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/osutil.py +0 -0
  19. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/pythonfmu-export/.clang-format +0 -0
  20. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/pythonfmu-export/CMakeLists.txt +0 -0
  21. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/pythonfmu-export/build_unix.sh +0 -0
  22. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/pythonfmu-export/build_win.sh +0 -0
  23. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/pythonfmu-export/src/CMakeLists.txt +0 -0
  24. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/pythonfmu-export/src/cppfmu/cppfmu_common.hpp +0 -0
  25. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/pythonfmu-export/src/cppfmu/cppfmu_cs.cpp +0 -0
  26. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/pythonfmu-export/src/cppfmu/cppfmu_cs.hpp +0 -0
  27. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/pythonfmu-export/src/cppfmu/fmi_functions.cpp +0 -0
  28. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/pythonfmu-export/src/fmi/fmi3FunctionTypes.h +0 -0
  29. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/pythonfmu-export/src/fmi/fmi3Functions.h +0 -0
  30. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/pythonfmu-export/src/fmi/fmi3PlatformTypes.h +0 -0
  31. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/pythonfmu-export/src/pythonfmu/IPyState.hpp +0 -0
  32. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/pythonfmu-export/src/pythonfmu/PySlaveInstance.cpp +0 -0
  33. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/pythonfmu-export/src/pythonfmu/PySlaveInstance.hpp +0 -0
  34. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/pythonfmu-export/src/pythonfmu/PyState.hpp +0 -0
  35. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/resources/binaries/x86_64-linux/libpythonfmu-export.so +0 -0
  36. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/tests/__init__.py +0 -0
  37. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/tests/conftest.py +0 -0
  38. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/tests/data/csvdemo.csv +0 -0
  39. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/tests/data/hello.txt +0 -0
  40. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/tests/slaves/PythonSlaveWithException.py +0 -0
  41. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/tests/slaves/localmodule.py +0 -0
  42. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/tests/slaves/pythonslave.py +0 -0
  43. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/tests/slaves/pythonslave_read_file.py +0 -0
  44. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/tests/slaves/slavewithdep.py +0 -0
  45. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/tests/test_deploy.py +0 -0
  46. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/tests/test_fmi3slave.py +0 -0
  47. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/tests/test_integration.py +0 -0
  48. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/tests/test_logger.py +0 -0
  49. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/tests/test_multiple_fmus.py +0 -0
  50. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/tests/test_variables.py +0 -0
  51. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/tests/utils.py +0 -0
  52. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/unit.py +0 -0
  53. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/variable_types.py +0 -0
  54. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3/variables.py +0 -0
  55. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3.egg-info/SOURCES.txt +0 -0
  56. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3.egg-info/dependency_links.txt +0 -0
  57. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3.egg-info/entry_points.txt +0 -0
  58. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3.egg-info/not-zip-safe +0 -0
  59. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3.egg-info/requires.txt +0 -0
  60. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/pythonfmu3.egg-info/top_level.txt +0 -0
  61. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/setup.cfg +0 -0
  62. {pythonfmu3-0.1.17 → pythonfmu3-0.1.18}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pythonfmu3
3
- Version: 0.1.17
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 TERMINALS_FOLDER] [--no-external-tool]
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 TERMINALS_FOLDER
83
- Folder of terminals to include in the FMU.
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 TERMINALS_FOLDER] [--no-external-tool]
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 TERMINALS_FOLDER
57
- Folder of terminals to include in the FMU.
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.1.18"
@@ -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
- terminals_folder: Optional[FilePath] = None,
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 terminals_folder is not None:
91
- terminals_folder = Path(terminals_folder)
92
- if not terminals_folder.exists():
90
+ if terminals is not None:
91
+ terminals = Path(terminals)
92
+ if not terminals.exists():
93
93
  raise ValueError(
94
- f"The terminals folder does not exists {terminals_folder!s}"
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 terminals_folder is not None:
190
- terminals = Path("terminalsAndIcons")
191
- for f in terminals_folder.rglob("*.xml"):
192
- if f.is_file():
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="terminals_folder",
237
- help="Folder containing terminals to include in the FMU.",
238
+ dest="terminals",
239
+ help="Terminals file (terminalsAndIcons.xml) to include in the FMU.",
238
240
  default=None
239
241
  )
240
242
 
@@ -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
- terminal1 = terminals_dir / "terminal1.xml"
187
- terminal1.write_text("Dummy Terminal 1")
186
+ terminals = terminals_dir / "terminalsAndIcons.xml"
187
+ terminals.write_text("Dummy Terminal 1")
188
188
 
189
- terminal2 = terminals_dir / "terminal2.xml"
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/terminal1.xml" in names
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.17
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 TERMINALS_FOLDER] [--no-external-tool]
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 TERMINALS_FOLDER
83
- Folder of terminals to include in the FMU.
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