pythonfmu3 0.2.2.2__py3-none-any.whl → 0.2.4__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/__init__.py +8 -8
- pythonfmu3/__main__.py +52 -52
- pythonfmu3/_version.py +1 -1
- pythonfmu3/builder.py +260 -260
- pythonfmu3/default_experiment.py +7 -7
- pythonfmu3/deploy.py +118 -118
- pythonfmu3/enums.py +48 -48
- pythonfmu3/fmi3slave.py +438 -438
- pythonfmu3/logmsg.py +14 -14
- pythonfmu3/osutil.py +22 -22
- pythonfmu3/pythonfmu-export/.clang-format +35 -35
- pythonfmu3/pythonfmu-export/CMakeLists.txt +59 -59
- pythonfmu3/pythonfmu-export/build_unix.sh +4 -4
- pythonfmu3/pythonfmu-export/build_win.sh +4 -4
- pythonfmu3/pythonfmu-export/src/CMakeLists.txt +45 -45
- pythonfmu3/pythonfmu-export/src/cppfmu/cppfmu_common.hpp +161 -161
- pythonfmu3/pythonfmu-export/src/cppfmu/cppfmu_cs.cpp +192 -192
- pythonfmu3/pythonfmu-export/src/cppfmu/cppfmu_cs.hpp +185 -185
- pythonfmu3/pythonfmu-export/src/cppfmu/fmi_functions.cpp +937 -937
- pythonfmu3/pythonfmu-export/src/fmi/fmi3FunctionTypes.h +638 -638
- pythonfmu3/pythonfmu-export/src/fmi/fmi3Functions.h +343 -343
- pythonfmu3/pythonfmu-export/src/fmi/fmi3PlatformTypes.h +94 -94
- pythonfmu3/pythonfmu-export/src/pythonfmu/IPyState.hpp +17 -17
- pythonfmu3/pythonfmu-export/src/pythonfmu/PySlaveInstance.cpp +744 -744
- pythonfmu3/pythonfmu-export/src/pythonfmu/PySlaveInstance.hpp +111 -111
- pythonfmu3/pythonfmu-export/src/pythonfmu/PyState.hpp +84 -84
- pythonfmu3/resources/binaries/x86_64-linux/libpythonfmu-export.so +0 -0
- pythonfmu3/resources/binaries/x86_64-windows/pythonfmu-export.dll +0 -0
- pythonfmu3/tests/conftest.py +5 -5
- pythonfmu3/tests/data/csvdemo.csv +7 -7
- pythonfmu3/tests/slaves/PythonSlaveWithException.py +18 -18
- pythonfmu3/tests/slaves/localmodule.py +8 -8
- pythonfmu3/tests/slaves/pythonslave.py +52 -52
- pythonfmu3/tests/slaves/pythonslave_read_file.py +23 -23
- pythonfmu3/tests/slaves/slavewithdep.py +21 -21
- pythonfmu3/tests/test_builder.py +195 -195
- pythonfmu3/tests/test_deploy.py +48 -48
- pythonfmu3/tests/test_fmi3slave.py +152 -152
- pythonfmu3/tests/test_integration.py +350 -350
- pythonfmu3/tests/test_logger.py +180 -180
- pythonfmu3/tests/test_multiple_fmus.py +141 -141
- pythonfmu3/tests/test_variables.py +334 -334
- pythonfmu3/tests/utils.py +13 -13
- pythonfmu3/unit.py +62 -62
- pythonfmu3/variable_types.py +101 -101
- pythonfmu3/variables.py +400 -400
- {pythonfmu3-0.2.2.2.dist-info → pythonfmu3-0.2.4.dist-info}/METADATA +7 -9
- pythonfmu3-0.2.4.dist-info/RECORD +54 -0
- {pythonfmu3-0.2.2.2.dist-info → pythonfmu3-0.2.4.dist-info}/WHEEL +1 -1
- {pythonfmu3-0.2.2.2.dist-info → pythonfmu3-0.2.4.dist-info}/entry_points.txt +0 -1
- pythonfmu3-0.2.2.2.dist-info/LICENSE.txt → pythonfmu3-0.2.4.dist-info/licenses/LICENSE +23 -23
- pythonfmu3/pythonfmu-export/build/ALL_BUILD.vcxproj +0 -184
- pythonfmu3/pythonfmu-export/build/ALL_BUILD.vcxproj.filters +0 -8
- pythonfmu3/pythonfmu-export/build/CMakeCache.txt +0 -369
- pythonfmu3/pythonfmu-export/build/CMakeFiles/0ee4db0675778dfba98c7160896d5a45/generate.stamp.rule +0 -1
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CMakeCCompiler.cmake +0 -72
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CMakeCXXCompiler.cmake +0 -83
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CMakeDetermineCompilerABI_C.bin +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CMakeDetermineCompilerABI_CXX.bin +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CMakeRCCompiler.cmake +0 -6
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CMakeSystem.cmake +0 -15
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdC/CMakeCCompilerId.c +0 -838
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdC/CompilerIdC.exe +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdC/CompilerIdC.vcxproj +0 -71
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdC/Debug/CMakeCCompilerId.obj +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdC/Debug/CompilerIdC.exe.recipe +0 -11
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdC/Debug/CompilerIdC.tlog/CL.command.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdC/Debug/CompilerIdC.tlog/CL.read.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdC/Debug/CompilerIdC.tlog/CL.write.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdC/Debug/CompilerIdC.tlog/CompilerIdC.lastbuildstate +0 -2
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdC/Debug/CompilerIdC.tlog/link.command.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdC/Debug/CompilerIdC.tlog/link.read.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdC/Debug/CompilerIdC.tlog/link.write.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -826
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdCXX/CompilerIdCXX.exe +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdCXX/CompilerIdCXX.vcxproj +0 -71
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdCXX/Debug/CMakeCXXCompilerId.obj +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdCXX/Debug/CompilerIdCXX.exe.recipe +0 -11
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CL.command.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CL.read.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CL.write.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CompilerIdCXX.lastbuildstate +0 -2
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdCXX/Debug/CompilerIdCXX.tlog/link.command.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdCXX/Debug/CompilerIdCXX.tlog/link.read.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/CompilerIdCXX/Debug/CompilerIdCXX.tlog/link.write.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/VCTargetsPath.txt +0 -1
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/VCTargetsPath.vcxproj +0 -31
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/x64/Debug/VCTargetsPath.recipe +0 -11
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.24.0/x64/Debug/VCTargetsPath.tlog/VCTargetsPath.lastbuildstate +0 -2
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CMakeCCompiler.cmake +0 -81
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CMakeCXXCompiler.cmake +0 -101
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CMakeDetermineCompilerABI_C.bin +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CMakeDetermineCompilerABI_CXX.bin +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CMakeRCCompiler.cmake +0 -6
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CMakeSystem.cmake +0 -15
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdC/CMakeCCompilerId.c +0 -904
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdC/CompilerIdC.exe +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdC/CompilerIdC.vcxproj +0 -72
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdC/Debug/CMakeCCompilerId.obj +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdC/Debug/CompilerIdC.exe.recipe +0 -11
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdC/Debug/CompilerIdC.tlog/CL.command.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdC/Debug/CompilerIdC.tlog/CL.read.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdC/Debug/CompilerIdC.tlog/CL.write.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdC/Debug/CompilerIdC.tlog/CompilerIdC.lastbuildstate +0 -2
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdC/Debug/CompilerIdC.tlog/link.command.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdC/Debug/CompilerIdC.tlog/link.read.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdC/Debug/CompilerIdC.tlog/link.write.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -919
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdCXX/CompilerIdCXX.exe +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdCXX/CompilerIdCXX.vcxproj +0 -72
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdCXX/Debug/CMakeCXXCompilerId.obj +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdCXX/Debug/CompilerIdCXX.exe.recipe +0 -11
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CL.command.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CL.read.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CL.write.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CompilerIdCXX.lastbuildstate +0 -2
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdCXX/Debug/CompilerIdCXX.tlog/link.command.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdCXX/Debug/CompilerIdCXX.tlog/link.read.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/CompilerIdCXX/Debug/CompilerIdCXX.tlog/link.write.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/VCTargetsPath.txt +0 -1
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/VCTargetsPath.vcxproj +0 -31
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/x64/Debug/VCTargetsPath.recipe +0 -11
- pythonfmu3/pythonfmu-export/build/CMakeFiles/3.30.2/x64/Debug/VCTargetsPath.tlog/VCTargetsPath.lastbuildstate +0 -2
- pythonfmu3/pythonfmu-export/build/CMakeFiles/CMakeConfigureLog.yaml +0 -568
- pythonfmu3/pythonfmu-export/build/CMakeFiles/CMakeOutput.log +0 -357
- pythonfmu3/pythonfmu-export/build/CMakeFiles/TargetDirectories.txt +0 -3
- pythonfmu3/pythonfmu-export/build/CMakeFiles/cmake.check_cache +0 -1
- pythonfmu3/pythonfmu-export/build/CMakeFiles/generate.stamp +0 -1
- pythonfmu3/pythonfmu-export/build/CMakeFiles/generate.stamp.depend +0 -28
- pythonfmu3/pythonfmu-export/build/CMakeFiles/generate.stamp.list +0 -2
- pythonfmu3/pythonfmu-export/build/ZERO_CHECK.vcxproj +0 -174
- pythonfmu3/pythonfmu-export/build/ZERO_CHECK.vcxproj.filters +0 -13
- pythonfmu3/pythonfmu-export/build/cmake_install.cmake +0 -50
- pythonfmu3/pythonfmu-export/build/install_manifest.txt +0 -0
- pythonfmu3/pythonfmu-export/build/pythonfmu-export.sln +0 -53
- pythonfmu3/pythonfmu-export/build/src/CMakeFiles/generate.stamp +0 -1
- pythonfmu3/pythonfmu-export/build/src/CMakeFiles/generate.stamp.depend +0 -2
- pythonfmu3/pythonfmu-export/build/src/Debug/pythonfmu-export.pdb +0 -0
- pythonfmu3/pythonfmu-export/build/src/Release/pythonfmu-export.exp +0 -0
- pythonfmu3/pythonfmu-export/build/src/Release/pythonfmu-export.lib +0 -0
- pythonfmu3/pythonfmu-export/build/src/cmake_install.cmake +0 -34
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Debug/PySlaveInstance.obj +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Debug/cppfmu_cs.obj +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Debug/exports.def +0 -1885
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Debug/fmi_functions.obj +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Debug/objects.txt +0 -3
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Debug/pythonfmu-export.tlog/CL.command.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Debug/pythonfmu-export.tlog/CL.read.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Debug/pythonfmu-export.tlog/CL.write.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Debug/pythonfmu-export.tlog/CustomBuild.command.1.tlog +0 -10
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Debug/pythonfmu-export.tlog/CustomBuild.read.1.tlog +0 -1
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Debug/pythonfmu-export.tlog/CustomBuild.write.1.tlog +0 -2
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Debug/pythonfmu-export.tlog/link.command.1.tlog +0 -1
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Debug/pythonfmu-export.tlog/link.read.1.tlog +0 -1
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Debug/pythonfmu-export.tlog/link.read.3.tlog +0 -1
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Debug/pythonfmu-export.tlog/link.write.1.tlog +0 -1
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Debug/pythonfmu-export.tlog/pythonfmu-export.lastbuildstate +0 -2
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Debug/pythonfmu-export.tlog/unsuccessfulbuild +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Debug/vc142.pdb +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/MinSizeRel/objects.txt +0 -3
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/RelWithDebInfo/objects.txt +0 -3
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Release/PySlaveInstance.obj +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Release/cppfmu_cs.obj +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Release/exports.def +0 -538
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Release/fmi_functions.obj +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Release/objects.txt +0 -3
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Release/pythonfmu-export.dll.recipe +0 -14
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Release/pythonfmu-export.tlog/CL.command.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Release/pythonfmu-export.tlog/CL.read.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Release/pythonfmu-export.tlog/CL.write.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Release/pythonfmu-export.tlog/CustomBuild.command.1.tlog +0 -10
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Release/pythonfmu-export.tlog/CustomBuild.read.1.tlog +0 -1
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Release/pythonfmu-export.tlog/CustomBuild.write.1.tlog +0 -2
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Release/pythonfmu-export.tlog/link.command.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Release/pythonfmu-export.tlog/link.delete.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Release/pythonfmu-export.tlog/link.read.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Release/pythonfmu-export.tlog/link.write.1.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Release/pythonfmu-export.tlog/pythonfmu-export.lastbuildstate +0 -2
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.dir/Release/pythonfmu-export.tlog/pythonfmu-export.write.1u.tlog +0 -0
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.vcxproj +0 -414
- pythonfmu3/pythonfmu-export/build/src/pythonfmu-export.vcxproj.filters +0 -48
- pythonfmu3/pythonfmu-export/build/x64/Debug/ZERO_CHECK/ZERO_CHECK.recipe +0 -11
- pythonfmu3/pythonfmu-export/build/x64/Debug/ZERO_CHECK/ZERO_CHECK.tlog/CustomBuild.command.1.tlog +0 -10
- pythonfmu3/pythonfmu-export/build/x64/Debug/ZERO_CHECK/ZERO_CHECK.tlog/CustomBuild.read.1.tlog +0 -29
- pythonfmu3/pythonfmu-export/build/x64/Debug/ZERO_CHECK/ZERO_CHECK.tlog/CustomBuild.write.1.tlog +0 -3
- pythonfmu3/pythonfmu-export/build/x64/Debug/ZERO_CHECK/ZERO_CHECK.tlog/ZERO_CHECK.lastbuildstate +0 -2
- pythonfmu3/pythonfmu-export/build/x64/Release/ALL_BUILD/ALL_BUILD.recipe +0 -17
- pythonfmu3/pythonfmu-export/build/x64/Release/ALL_BUILD/ALL_BUILD.tlog/ALL_BUILD.lastbuildstate +0 -2
- pythonfmu3/pythonfmu-export/build/x64/Release/ALL_BUILD/ALL_BUILD.tlog/CustomBuild.command.1.tlog +0 -10
- pythonfmu3/pythonfmu-export/build/x64/Release/ALL_BUILD/ALL_BUILD.tlog/CustomBuild.read.1.tlog +0 -27
- pythonfmu3/pythonfmu-export/build/x64/Release/ALL_BUILD/ALL_BUILD.tlog/CustomBuild.write.1.tlog +0 -2
- pythonfmu3/pythonfmu-export/build/x64/Release/ZERO_CHECK/ZERO_CHECK.recipe +0 -11
- pythonfmu3/pythonfmu-export/build/x64/Release/ZERO_CHECK/ZERO_CHECK.tlog/CustomBuild.command.1.tlog +0 -10
- pythonfmu3/pythonfmu-export/build/x64/Release/ZERO_CHECK/ZERO_CHECK.tlog/CustomBuild.read.1.tlog +0 -29
- pythonfmu3/pythonfmu-export/build/x64/Release/ZERO_CHECK/ZERO_CHECK.tlog/CustomBuild.write.1.tlog +0 -3
- pythonfmu3/pythonfmu-export/build/x64/Release/ZERO_CHECK/ZERO_CHECK.tlog/ZERO_CHECK.lastbuildstate +0 -2
- pythonfmu3/resources/binaries/x86_64-windows1/pythonfmu-export.dll +0 -0
- pythonfmu3-0.2.2.2.dist-info/RECORD +0 -200
- {pythonfmu3-0.2.2.2.dist-info → pythonfmu3-0.2.4.dist-info}/top_level.txt +0 -0
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
|
|
2
|
-
#ifndef PYTHONFMU_SLAVEINSTANCE_HPP
|
|
3
|
-
#define PYTHONFMU_SLAVEINSTANCE_HPP
|
|
4
|
-
|
|
5
|
-
#include "cppfmu/cppfmu_cs.hpp"
|
|
6
|
-
#include "pythonfmu/IPyState.hpp"
|
|
7
|
-
|
|
8
|
-
#include <Python.h>
|
|
9
|
-
#include <string>
|
|
10
|
-
#include <vector>
|
|
11
|
-
|
|
12
|
-
namespace pythonfmu
|
|
13
|
-
{
|
|
14
|
-
|
|
15
|
-
class PySlaveInstance : public cppfmu::SlaveInstance
|
|
16
|
-
{
|
|
17
|
-
|
|
18
|
-
public:
|
|
19
|
-
PySlaveInstance(std::string instanceName, std::string resources, const cppfmu::Logger& logger, bool visible, std::shared_ptr<IPyState> pyState);
|
|
20
|
-
|
|
21
|
-
void initialize(PyGILState_STATE gilState);
|
|
22
|
-
|
|
23
|
-
void SetupExperiment(cppfmu::FMIBoolean toleranceDefined, cppfmu::FMIFloat64 tolerance, cppfmu::FMIFloat64 tStart, cppfmu::FMIBoolean stopTimeDefined, cppfmu::FMIFloat64 tStop) override;
|
|
24
|
-
void EnterInitializationMode() override;
|
|
25
|
-
void ExitInitializationMode() override;
|
|
26
|
-
void Terminate() override;
|
|
27
|
-
void Reset() override;
|
|
28
|
-
cppfmu::FMIStatus DoStep(cppfmu::FMIFloat64 currentCommunicationPoint,
|
|
29
|
-
cppfmu::FMIFloat64 communicationStepSize,
|
|
30
|
-
cppfmu::FMIBoolean newStep,
|
|
31
|
-
cppfmu::FMIBoolean* eventHandlingNeeded,
|
|
32
|
-
cppfmu::FMIBoolean* terminateSimulation,
|
|
33
|
-
cppfmu::FMIBoolean* earlyReturn,
|
|
34
|
-
cppfmu::FMIFloat64& endOfStep) override;
|
|
35
|
-
|
|
36
|
-
void SetFloat64(const cppfmu::FMIValueReference* vr, std::size_t nvr, const cppfmu::FMIFloat64* value, std::size_t nValues) override;
|
|
37
|
-
void SetInt32(const cppfmu::FMIValueReference* vr, std::size_t nvr, const cppfmu::FMIInt32* value) override;
|
|
38
|
-
void SetInt64(const cppfmu::FMIValueReference* vr, std::size_t nvr, const cppfmu::FMIInt64* value) override;
|
|
39
|
-
void SetUInt64(const cppfmu::FMIValueReference* vr, std::size_t nvr, const cppfmu::FMIUInt64* value) override;
|
|
40
|
-
void SetBoolean(const cppfmu::FMIValueReference* vr, std::size_t nvr, const cppfmu::FMIBoolean* value) override;
|
|
41
|
-
void SetString(const cppfmu::FMIValueReference* vr, std::size_t nvr, cppfmu::FMIString const* value) override;
|
|
42
|
-
|
|
43
|
-
void GetFloat64(const cppfmu::FMIValueReference* vr, std::size_t nvr, cppfmu::FMIFloat64* value, std::size_t nValues) const override;
|
|
44
|
-
void GetInt32(const cppfmu::FMIValueReference* vr, std::size_t nvr, cppfmu::FMIInt32* value) const override;
|
|
45
|
-
void GetInt64(const cppfmu::FMIValueReference* vr, std::size_t nvr, cppfmu::FMIInt64* value) const override;
|
|
46
|
-
void GetUInt64(const cppfmu::FMIValueReference* vr, std::size_t nvr, cppfmu::FMIUInt64* value) const override;
|
|
47
|
-
void GetBoolean(const cppfmu::FMIValueReference* vr, std::size_t nvr, cppfmu::FMIBoolean* value) const override;
|
|
48
|
-
void GetString(const cppfmu::FMIValueReference* vr, std::size_t nvr, cppfmu::FMIString* value) const override;
|
|
49
|
-
|
|
50
|
-
void GetFMUstate(fmi3FMUState& State) override;
|
|
51
|
-
void SetFMUstate(const fmi3FMUState& State) override;
|
|
52
|
-
void FreeFMUstate(fmi3FMUState& State) override;
|
|
53
|
-
|
|
54
|
-
size_t SerializedFMUstateSize(const fmi3FMUState& State) override;
|
|
55
|
-
void SerializeFMUstate(const fmi3FMUState& State, fmi3Byte bytes[], size_t size) override;
|
|
56
|
-
void DeSerializeFMUstate(const fmi3Byte bytes[], size_t size, fmi3FMUState& State) override;
|
|
57
|
-
|
|
58
|
-
void clearLogBuffer() const;
|
|
59
|
-
|
|
60
|
-
~PySlaveInstance() override;
|
|
61
|
-
|
|
62
|
-
private:
|
|
63
|
-
std::shared_ptr<IPyState> pyState_;
|
|
64
|
-
PyObject* pClass_;
|
|
65
|
-
PyObject* pInstance_{};
|
|
66
|
-
PyObject* pMessages_{};
|
|
67
|
-
|
|
68
|
-
const bool visible_;
|
|
69
|
-
const std::string instanceName_;
|
|
70
|
-
const std::string resources_;
|
|
71
|
-
const cppfmu::Logger& logger_;
|
|
72
|
-
|
|
73
|
-
mutable std::vector<PyObject*> strBuffer;
|
|
74
|
-
mutable std::vector<PyObject*> logStrBuffer;
|
|
75
|
-
|
|
76
|
-
void handle_py_exception(const std::string& what, PyGILState_STATE gilState) const;
|
|
77
|
-
|
|
78
|
-
inline void clearStrBuffer() const
|
|
79
|
-
{
|
|
80
|
-
if (!strBuffer.empty()) {
|
|
81
|
-
for (auto obj : strBuffer) {
|
|
82
|
-
Py_DECREF(obj);
|
|
83
|
-
}
|
|
84
|
-
strBuffer.clear();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
inline void clearLogStrBuffer() const
|
|
89
|
-
{
|
|
90
|
-
if (!logStrBuffer.empty()) {
|
|
91
|
-
for (auto obj : logStrBuffer) {
|
|
92
|
-
Py_DECREF(obj);
|
|
93
|
-
}
|
|
94
|
-
logStrBuffer.clear();
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
inline void cleanPyObject() const
|
|
99
|
-
{
|
|
100
|
-
clearLogBuffer();
|
|
101
|
-
clearLogStrBuffer();
|
|
102
|
-
clearStrBuffer();
|
|
103
|
-
Py_XDECREF(pClass_);
|
|
104
|
-
Py_XDECREF(pInstance_);
|
|
105
|
-
Py_XDECREF(pMessages_);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
} // namespace pythonfmu
|
|
110
|
-
|
|
111
|
-
#endif
|
|
1
|
+
|
|
2
|
+
#ifndef PYTHONFMU_SLAVEINSTANCE_HPP
|
|
3
|
+
#define PYTHONFMU_SLAVEINSTANCE_HPP
|
|
4
|
+
|
|
5
|
+
#include "cppfmu/cppfmu_cs.hpp"
|
|
6
|
+
#include "pythonfmu/IPyState.hpp"
|
|
7
|
+
|
|
8
|
+
#include <Python.h>
|
|
9
|
+
#include <string>
|
|
10
|
+
#include <vector>
|
|
11
|
+
|
|
12
|
+
namespace pythonfmu
|
|
13
|
+
{
|
|
14
|
+
|
|
15
|
+
class PySlaveInstance : public cppfmu::SlaveInstance
|
|
16
|
+
{
|
|
17
|
+
|
|
18
|
+
public:
|
|
19
|
+
PySlaveInstance(std::string instanceName, std::string resources, const cppfmu::Logger& logger, bool visible, std::shared_ptr<IPyState> pyState);
|
|
20
|
+
|
|
21
|
+
void initialize(PyGILState_STATE gilState);
|
|
22
|
+
|
|
23
|
+
void SetupExperiment(cppfmu::FMIBoolean toleranceDefined, cppfmu::FMIFloat64 tolerance, cppfmu::FMIFloat64 tStart, cppfmu::FMIBoolean stopTimeDefined, cppfmu::FMIFloat64 tStop) override;
|
|
24
|
+
void EnterInitializationMode() override;
|
|
25
|
+
void ExitInitializationMode() override;
|
|
26
|
+
void Terminate() override;
|
|
27
|
+
void Reset() override;
|
|
28
|
+
cppfmu::FMIStatus DoStep(cppfmu::FMIFloat64 currentCommunicationPoint,
|
|
29
|
+
cppfmu::FMIFloat64 communicationStepSize,
|
|
30
|
+
cppfmu::FMIBoolean newStep,
|
|
31
|
+
cppfmu::FMIBoolean* eventHandlingNeeded,
|
|
32
|
+
cppfmu::FMIBoolean* terminateSimulation,
|
|
33
|
+
cppfmu::FMIBoolean* earlyReturn,
|
|
34
|
+
cppfmu::FMIFloat64& endOfStep) override;
|
|
35
|
+
|
|
36
|
+
void SetFloat64(const cppfmu::FMIValueReference* vr, std::size_t nvr, const cppfmu::FMIFloat64* value, std::size_t nValues) override;
|
|
37
|
+
void SetInt32(const cppfmu::FMIValueReference* vr, std::size_t nvr, const cppfmu::FMIInt32* value) override;
|
|
38
|
+
void SetInt64(const cppfmu::FMIValueReference* vr, std::size_t nvr, const cppfmu::FMIInt64* value) override;
|
|
39
|
+
void SetUInt64(const cppfmu::FMIValueReference* vr, std::size_t nvr, const cppfmu::FMIUInt64* value) override;
|
|
40
|
+
void SetBoolean(const cppfmu::FMIValueReference* vr, std::size_t nvr, const cppfmu::FMIBoolean* value) override;
|
|
41
|
+
void SetString(const cppfmu::FMIValueReference* vr, std::size_t nvr, cppfmu::FMIString const* value) override;
|
|
42
|
+
|
|
43
|
+
void GetFloat64(const cppfmu::FMIValueReference* vr, std::size_t nvr, cppfmu::FMIFloat64* value, std::size_t nValues) const override;
|
|
44
|
+
void GetInt32(const cppfmu::FMIValueReference* vr, std::size_t nvr, cppfmu::FMIInt32* value) const override;
|
|
45
|
+
void GetInt64(const cppfmu::FMIValueReference* vr, std::size_t nvr, cppfmu::FMIInt64* value) const override;
|
|
46
|
+
void GetUInt64(const cppfmu::FMIValueReference* vr, std::size_t nvr, cppfmu::FMIUInt64* value) const override;
|
|
47
|
+
void GetBoolean(const cppfmu::FMIValueReference* vr, std::size_t nvr, cppfmu::FMIBoolean* value) const override;
|
|
48
|
+
void GetString(const cppfmu::FMIValueReference* vr, std::size_t nvr, cppfmu::FMIString* value) const override;
|
|
49
|
+
|
|
50
|
+
void GetFMUstate(fmi3FMUState& State) override;
|
|
51
|
+
void SetFMUstate(const fmi3FMUState& State) override;
|
|
52
|
+
void FreeFMUstate(fmi3FMUState& State) override;
|
|
53
|
+
|
|
54
|
+
size_t SerializedFMUstateSize(const fmi3FMUState& State) override;
|
|
55
|
+
void SerializeFMUstate(const fmi3FMUState& State, fmi3Byte bytes[], size_t size) override;
|
|
56
|
+
void DeSerializeFMUstate(const fmi3Byte bytes[], size_t size, fmi3FMUState& State) override;
|
|
57
|
+
|
|
58
|
+
void clearLogBuffer() const;
|
|
59
|
+
|
|
60
|
+
~PySlaveInstance() override;
|
|
61
|
+
|
|
62
|
+
private:
|
|
63
|
+
std::shared_ptr<IPyState> pyState_;
|
|
64
|
+
PyObject* pClass_;
|
|
65
|
+
PyObject* pInstance_{};
|
|
66
|
+
PyObject* pMessages_{};
|
|
67
|
+
|
|
68
|
+
const bool visible_;
|
|
69
|
+
const std::string instanceName_;
|
|
70
|
+
const std::string resources_;
|
|
71
|
+
const cppfmu::Logger& logger_;
|
|
72
|
+
|
|
73
|
+
mutable std::vector<PyObject*> strBuffer;
|
|
74
|
+
mutable std::vector<PyObject*> logStrBuffer;
|
|
75
|
+
|
|
76
|
+
void handle_py_exception(const std::string& what, PyGILState_STATE gilState) const;
|
|
77
|
+
|
|
78
|
+
inline void clearStrBuffer() const
|
|
79
|
+
{
|
|
80
|
+
if (!strBuffer.empty()) {
|
|
81
|
+
for (auto obj : strBuffer) {
|
|
82
|
+
Py_DECREF(obj);
|
|
83
|
+
}
|
|
84
|
+
strBuffer.clear();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
inline void clearLogStrBuffer() const
|
|
89
|
+
{
|
|
90
|
+
if (!logStrBuffer.empty()) {
|
|
91
|
+
for (auto obj : logStrBuffer) {
|
|
92
|
+
Py_DECREF(obj);
|
|
93
|
+
}
|
|
94
|
+
logStrBuffer.clear();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
inline void cleanPyObject() const
|
|
99
|
+
{
|
|
100
|
+
clearLogBuffer();
|
|
101
|
+
clearLogStrBuffer();
|
|
102
|
+
clearStrBuffer();
|
|
103
|
+
Py_XDECREF(pClass_);
|
|
104
|
+
Py_XDECREF(pInstance_);
|
|
105
|
+
Py_XDECREF(pMessages_);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
} // namespace pythonfmu
|
|
110
|
+
|
|
111
|
+
#endif
|
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
#ifndef PYTHONFMU_PYTHONSTATE_HPP
|
|
3
|
-
#define PYTHONFMU_PYTHONSTATE_HPP
|
|
4
|
-
|
|
5
|
-
#include "IPyState.hpp"
|
|
6
|
-
#include <Python.h>
|
|
7
|
-
#include <condition_variable>
|
|
8
|
-
#include <iostream>
|
|
9
|
-
#include <mutex>
|
|
10
|
-
#include <thread>
|
|
11
|
-
|
|
12
|
-
namespace pythonfmu
|
|
13
|
-
{
|
|
14
|
-
class PyState : public IPyState
|
|
15
|
-
{
|
|
16
|
-
public:
|
|
17
|
-
PyState()
|
|
18
|
-
: _initDeinitPyThread_{ &PyState::Worker, this }
|
|
19
|
-
{
|
|
20
|
-
auto lock = std::unique_lock{ mutex_ };
|
|
21
|
-
conditionalVariable_.wait(lock, [&] { return consructed_; });
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
~PyState() override
|
|
25
|
-
{
|
|
26
|
-
{
|
|
27
|
-
auto const lock = std::lock_guard{ mutex_ };
|
|
28
|
-
destroyRequested_ = true;
|
|
29
|
-
}
|
|
30
|
-
conditionalVariable_.notify_one();
|
|
31
|
-
if (_initDeinitPyThread_.joinable()) _initDeinitPyThread_.join();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
private:
|
|
35
|
-
|
|
36
|
-
// In accordance to the documentation https://docs.python.org/3/c-api/init.html#c.Py_FinalizeEx
|
|
37
|
-
// the Py_Initialize/Py_Finalize should be called from the same
|
|
38
|
-
// thread. The FMI standard allows to call fmi functions from different threads, also different threads
|
|
39
|
-
// could be used for loading unloading the FMU libraries. There is a deadlock, when the simulation tool
|
|
40
|
-
// unloads the FMU library from the thread which is differs from the thread where the Py_Initialize was called.
|
|
41
|
-
// Create a new thread which is used for calling Py_Initialize and Py_Deinitialize. The thread waits for
|
|
42
|
-
// notification from destructor and then calls Py_Deinitialize.
|
|
43
|
-
|
|
44
|
-
void Worker()
|
|
45
|
-
{
|
|
46
|
-
// It will be nullptr in case when some other tool already called Py_IsInitialized.
|
|
47
|
-
// There is no need to call Py_Finalize thus, this thread can exit ASAP.
|
|
48
|
-
auto const mainPyThread = []() -> PyThreadState* {
|
|
49
|
-
auto const justInitialized = !Py_IsInitialized();
|
|
50
|
-
if (justInitialized) {
|
|
51
|
-
Py_SetProgramName(L"./PythonFMU");
|
|
52
|
-
Py_Initialize();
|
|
53
|
-
#if PY_VERSION_HEX < 0x03070000
|
|
54
|
-
PyEval_InitThreads();
|
|
55
|
-
#endif
|
|
56
|
-
return PyEval_SaveThread();
|
|
57
|
-
}
|
|
58
|
-
return nullptr;
|
|
59
|
-
}();
|
|
60
|
-
|
|
61
|
-
{
|
|
62
|
-
auto const lock = std::lock_guard{ mutex_ };
|
|
63
|
-
consructed_ = true;
|
|
64
|
-
}
|
|
65
|
-
conditionalVariable_.notify_one();
|
|
66
|
-
|
|
67
|
-
if (nullptr != mainPyThread) {
|
|
68
|
-
auto lock = std::unique_lock{ mutex_ };
|
|
69
|
-
conditionalVariable_.wait(lock, [&] { return destroyRequested_; });
|
|
70
|
-
|
|
71
|
-
PyEval_RestoreThread(mainPyThread);
|
|
72
|
-
Py_Finalize();
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
bool consructed_ = false;
|
|
77
|
-
bool destroyRequested_ = false;
|
|
78
|
-
std::condition_variable conditionalVariable_;
|
|
79
|
-
std::mutex mutex_;
|
|
80
|
-
std::thread _initDeinitPyThread_;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
} // namespace pythonfmu
|
|
84
|
-
|
|
1
|
+
|
|
2
|
+
#ifndef PYTHONFMU_PYTHONSTATE_HPP
|
|
3
|
+
#define PYTHONFMU_PYTHONSTATE_HPP
|
|
4
|
+
|
|
5
|
+
#include "IPyState.hpp"
|
|
6
|
+
#include <Python.h>
|
|
7
|
+
#include <condition_variable>
|
|
8
|
+
#include <iostream>
|
|
9
|
+
#include <mutex>
|
|
10
|
+
#include <thread>
|
|
11
|
+
|
|
12
|
+
namespace pythonfmu
|
|
13
|
+
{
|
|
14
|
+
class PyState : public IPyState
|
|
15
|
+
{
|
|
16
|
+
public:
|
|
17
|
+
PyState()
|
|
18
|
+
: _initDeinitPyThread_{ &PyState::Worker, this }
|
|
19
|
+
{
|
|
20
|
+
auto lock = std::unique_lock{ mutex_ };
|
|
21
|
+
conditionalVariable_.wait(lock, [&] { return consructed_; });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
~PyState() override
|
|
25
|
+
{
|
|
26
|
+
{
|
|
27
|
+
auto const lock = std::lock_guard{ mutex_ };
|
|
28
|
+
destroyRequested_ = true;
|
|
29
|
+
}
|
|
30
|
+
conditionalVariable_.notify_one();
|
|
31
|
+
if (_initDeinitPyThread_.joinable()) _initDeinitPyThread_.join();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
private:
|
|
35
|
+
|
|
36
|
+
// In accordance to the documentation https://docs.python.org/3/c-api/init.html#c.Py_FinalizeEx
|
|
37
|
+
// the Py_Initialize/Py_Finalize should be called from the same
|
|
38
|
+
// thread. The FMI standard allows to call fmi functions from different threads, also different threads
|
|
39
|
+
// could be used for loading unloading the FMU libraries. There is a deadlock, when the simulation tool
|
|
40
|
+
// unloads the FMU library from the thread which is differs from the thread where the Py_Initialize was called.
|
|
41
|
+
// Create a new thread which is used for calling Py_Initialize and Py_Deinitialize. The thread waits for
|
|
42
|
+
// notification from destructor and then calls Py_Deinitialize.
|
|
43
|
+
|
|
44
|
+
void Worker()
|
|
45
|
+
{
|
|
46
|
+
// It will be nullptr in case when some other tool already called Py_IsInitialized.
|
|
47
|
+
// There is no need to call Py_Finalize thus, this thread can exit ASAP.
|
|
48
|
+
auto const mainPyThread = []() -> PyThreadState* {
|
|
49
|
+
auto const justInitialized = !Py_IsInitialized();
|
|
50
|
+
if (justInitialized) {
|
|
51
|
+
Py_SetProgramName(L"./PythonFMU");
|
|
52
|
+
Py_Initialize();
|
|
53
|
+
#if PY_VERSION_HEX < 0x03070000
|
|
54
|
+
PyEval_InitThreads();
|
|
55
|
+
#endif
|
|
56
|
+
return PyEval_SaveThread();
|
|
57
|
+
}
|
|
58
|
+
return nullptr;
|
|
59
|
+
}();
|
|
60
|
+
|
|
61
|
+
{
|
|
62
|
+
auto const lock = std::lock_guard{ mutex_ };
|
|
63
|
+
consructed_ = true;
|
|
64
|
+
}
|
|
65
|
+
conditionalVariable_.notify_one();
|
|
66
|
+
|
|
67
|
+
if (nullptr != mainPyThread) {
|
|
68
|
+
auto lock = std::unique_lock{ mutex_ };
|
|
69
|
+
conditionalVariable_.wait(lock, [&] { return destroyRequested_; });
|
|
70
|
+
|
|
71
|
+
PyEval_RestoreThread(mainPyThread);
|
|
72
|
+
Py_Finalize();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
bool consructed_ = false;
|
|
77
|
+
bool destroyRequested_ = false;
|
|
78
|
+
std::condition_variable conditionalVariable_;
|
|
79
|
+
std::mutex mutex_;
|
|
80
|
+
std::thread _initDeinitPyThread_;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
} // namespace pythonfmu
|
|
84
|
+
|
|
85
85
|
#endif //PYTHONFMU_PYTHONSTATE_HPP
|
|
Binary file
|
|
Binary file
|
pythonfmu3/tests/conftest.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
def pytest_configure(config):
|
|
4
|
-
config.addinivalue_line(
|
|
5
|
-
"markers", "requirements(pkg): mark test as requiring the specified package"
|
|
1
|
+
import pytest
|
|
2
|
+
|
|
3
|
+
def pytest_configure(config):
|
|
4
|
+
config.addinivalue_line(
|
|
5
|
+
"markers", "requirements(pkg): mark test as requiring the specified package"
|
|
6
6
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
t, default_Float64, submodel.int [1 INTEGER], real[1][REAL], bool[BOOLEAN], string [STRING]
|
|
2
|
-
0.0, -1, 1, 2.0, true,"1"
|
|
3
|
-
0.1,-1, 2, 4.0, false, "2"
|
|
4
|
-
0.2, -1, 3, 8.0, true, "3"
|
|
5
|
-
0.3, -1, 4, 16.0,false, "4"
|
|
6
|
-
0.4, -1, 5, 32.0, true, "5"
|
|
7
|
-
0.5, -1,6, 64.0, false, "6"
|
|
1
|
+
t, default_Float64, submodel.int [1 INTEGER], real[1][REAL], bool[BOOLEAN], string [STRING]
|
|
2
|
+
0.0, -1, 1, 2.0, true,"1"
|
|
3
|
+
0.1,-1, 2, 4.0, false, "2"
|
|
4
|
+
0.2, -1, 3, 8.0, true, "3"
|
|
5
|
+
0.3, -1, 4, 16.0,false, "4"
|
|
6
|
+
0.4, -1, 5, 32.0, true, "5"
|
|
7
|
+
0.5, -1,6, 64.0, false, "6"
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
from pythonfmu3.fmi3slave import Fmi3Slave, Fmi3Causality, Float64, Fmi3Variability
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class PythonSlaveWithException(Fmi3Slave):
|
|
5
|
-
|
|
6
|
-
def __init__(self, **kwargs):
|
|
7
|
-
super().__init__(**kwargs)
|
|
8
|
-
|
|
9
|
-
self.realIn = 22.0
|
|
10
|
-
self.realOut = 0.0
|
|
11
|
-
self.time = 0
|
|
12
|
-
|
|
13
|
-
self.register_variable(Float64("time", causality=Fmi3Causality.independent, variability=Fmi3Variability.continuous))
|
|
14
|
-
self.register_variable(Float64("realIn", causality=Fmi3Causality.input))
|
|
15
|
-
self.register_variable(Float64("realOut", causality=Fmi3Causality.output))
|
|
16
|
-
|
|
17
|
-
def do_step(self, current_time, step_size):
|
|
18
|
-
raise RuntimeError()
|
|
1
|
+
from pythonfmu3.fmi3slave import Fmi3Slave, Fmi3Causality, Float64, Fmi3Variability
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class PythonSlaveWithException(Fmi3Slave):
|
|
5
|
+
|
|
6
|
+
def __init__(self, **kwargs):
|
|
7
|
+
super().__init__(**kwargs)
|
|
8
|
+
|
|
9
|
+
self.realIn = 22.0
|
|
10
|
+
self.realOut = 0.0
|
|
11
|
+
self.time = 0
|
|
12
|
+
|
|
13
|
+
self.register_variable(Float64("time", causality=Fmi3Causality.independent, variability=Fmi3Variability.continuous))
|
|
14
|
+
self.register_variable(Float64("realIn", causality=Fmi3Causality.input))
|
|
15
|
+
self.register_variable(Float64("realOut", causality=Fmi3Causality.output))
|
|
16
|
+
|
|
17
|
+
def do_step(self, current_time, step_size):
|
|
18
|
+
raise RuntimeError()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
def get_amplitude():
|
|
4
|
-
return 5.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def get_time_constant():
|
|
8
|
-
return 0.1
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
def get_amplitude():
|
|
4
|
+
return 5.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def get_time_constant():
|
|
8
|
+
return 0.1
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
from pythonfmu3.fmi3slave import Fmi3Slave, Fmi3Causality, Fmi3Variability, Int32, Float64, Boolean, String
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class Container:
|
|
5
|
-
pass
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class PythonSlave(Fmi3Slave):
|
|
9
|
-
|
|
10
|
-
author = "John Doe"
|
|
11
|
-
description = "A simple description"
|
|
12
|
-
|
|
13
|
-
def __init__(self, **kwargs):
|
|
14
|
-
super().__init__(**kwargs)
|
|
15
|
-
|
|
16
|
-
self.intParam = 42
|
|
17
|
-
self.intOut = 23
|
|
18
|
-
self.realOut = 3.0
|
|
19
|
-
self.booleanVariable = True
|
|
20
|
-
self.stringVariable = "Hello World!"
|
|
21
|
-
self.realIn = 2. / 3.
|
|
22
|
-
self.booleanParameter = False
|
|
23
|
-
self.stringParameter = "dog"
|
|
24
|
-
self.time = 0
|
|
25
|
-
|
|
26
|
-
self.register_variable(Float64("time", causality=Fmi3Causality.independent, variability=Fmi3Variability.continuous))
|
|
27
|
-
self.register_variable(
|
|
28
|
-
Int32("intParam", causality=Fmi3Causality.parameter, variability=Fmi3Variability.tunable))
|
|
29
|
-
self.register_variable(Float64("realIn", causality=Fmi3Causality.input))
|
|
30
|
-
self.register_variable(
|
|
31
|
-
Boolean("booleanParameter", causality=Fmi3Causality.parameter, variability=Fmi3Variability.tunable))
|
|
32
|
-
self.register_variable(
|
|
33
|
-
String("stringParameter", causality=Fmi3Causality.parameter, variability=Fmi3Variability.tunable))
|
|
34
|
-
|
|
35
|
-
self.register_variable(Int32("intOut", causality=Fmi3Causality.output))
|
|
36
|
-
self.register_variable(Float64("realOut", causality=Fmi3Causality.output))
|
|
37
|
-
self.register_variable(Boolean("booleanVariable", causality=Fmi3Causality.local))
|
|
38
|
-
self.register_variable(String("stringVariable", causality=Fmi3Causality.local))
|
|
39
|
-
|
|
40
|
-
self.container = Container()
|
|
41
|
-
self.container.someReal = 99.0
|
|
42
|
-
self.container.subContainer = sub = Container()
|
|
43
|
-
sub.someInteger = -15
|
|
44
|
-
self.register_variable(
|
|
45
|
-
Float64("container.someReal", causality=Fmi3Causality.parameter, variability=Fmi3Variability.tunable))
|
|
46
|
-
self.register_variable(
|
|
47
|
-
Int32("container.subContainer.someInteger", causality=Fmi3Causality.parameter,
|
|
48
|
-
variability=Fmi3Variability.tunable))
|
|
49
|
-
|
|
50
|
-
def do_step(self, current_time, step_size):
|
|
51
|
-
self.realOut = current_time + step_size
|
|
52
|
-
return True
|
|
1
|
+
from pythonfmu3.fmi3slave import Fmi3Slave, Fmi3Causality, Fmi3Variability, Int32, Float64, Boolean, String
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Container:
|
|
5
|
+
pass
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class PythonSlave(Fmi3Slave):
|
|
9
|
+
|
|
10
|
+
author = "John Doe"
|
|
11
|
+
description = "A simple description"
|
|
12
|
+
|
|
13
|
+
def __init__(self, **kwargs):
|
|
14
|
+
super().__init__(**kwargs)
|
|
15
|
+
|
|
16
|
+
self.intParam = 42
|
|
17
|
+
self.intOut = 23
|
|
18
|
+
self.realOut = 3.0
|
|
19
|
+
self.booleanVariable = True
|
|
20
|
+
self.stringVariable = "Hello World!"
|
|
21
|
+
self.realIn = 2. / 3.
|
|
22
|
+
self.booleanParameter = False
|
|
23
|
+
self.stringParameter = "dog"
|
|
24
|
+
self.time = 0
|
|
25
|
+
|
|
26
|
+
self.register_variable(Float64("time", causality=Fmi3Causality.independent, variability=Fmi3Variability.continuous))
|
|
27
|
+
self.register_variable(
|
|
28
|
+
Int32("intParam", causality=Fmi3Causality.parameter, variability=Fmi3Variability.tunable))
|
|
29
|
+
self.register_variable(Float64("realIn", causality=Fmi3Causality.input))
|
|
30
|
+
self.register_variable(
|
|
31
|
+
Boolean("booleanParameter", causality=Fmi3Causality.parameter, variability=Fmi3Variability.tunable))
|
|
32
|
+
self.register_variable(
|
|
33
|
+
String("stringParameter", causality=Fmi3Causality.parameter, variability=Fmi3Variability.tunable))
|
|
34
|
+
|
|
35
|
+
self.register_variable(Int32("intOut", causality=Fmi3Causality.output))
|
|
36
|
+
self.register_variable(Float64("realOut", causality=Fmi3Causality.output))
|
|
37
|
+
self.register_variable(Boolean("booleanVariable", causality=Fmi3Causality.local))
|
|
38
|
+
self.register_variable(String("stringVariable", causality=Fmi3Causality.local))
|
|
39
|
+
|
|
40
|
+
self.container = Container()
|
|
41
|
+
self.container.someReal = 99.0
|
|
42
|
+
self.container.subContainer = sub = Container()
|
|
43
|
+
sub.someInteger = -15
|
|
44
|
+
self.register_variable(
|
|
45
|
+
Float64("container.someReal", causality=Fmi3Causality.parameter, variability=Fmi3Variability.tunable))
|
|
46
|
+
self.register_variable(
|
|
47
|
+
Int32("container.subContainer.someInteger", causality=Fmi3Causality.parameter,
|
|
48
|
+
variability=Fmi3Variability.tunable))
|
|
49
|
+
|
|
50
|
+
def do_step(self, current_time, step_size):
|
|
51
|
+
self.realOut = current_time + step_size
|
|
52
|
+
return True
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
from pythonfmu3.fmi3slave import Fmi3Slave, Fmi3Causality, Fmi3Variability, String, DefaultExperiment, Float64
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class PythonSlaveReadFile(Fmi3Slave):
|
|
5
|
-
|
|
6
|
-
default_experiment = DefaultExperiment(start_time=0)
|
|
7
|
-
|
|
8
|
-
def __init__(self, **kwargs):
|
|
9
|
-
super().__init__(**kwargs)
|
|
10
|
-
|
|
11
|
-
with (open(f'{self.resources}/hello.txt', 'r')) as file:
|
|
12
|
-
data = file.read()
|
|
13
|
-
|
|
14
|
-
self.time = 0
|
|
15
|
-
|
|
16
|
-
self.register_variable(Float64("time", causality=Fmi3Causality.independent, variability=Fmi3Variability.continuous))
|
|
17
|
-
self.register_variable(
|
|
18
|
-
String("file_content", getter=lambda: data,
|
|
19
|
-
causality=Fmi3Causality.output,
|
|
20
|
-
variability=Fmi3Variability.constant))
|
|
21
|
-
|
|
22
|
-
def do_step(self, current_time, step_size):
|
|
23
|
-
return True
|
|
1
|
+
from pythonfmu3.fmi3slave import Fmi3Slave, Fmi3Causality, Fmi3Variability, String, DefaultExperiment, Float64
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class PythonSlaveReadFile(Fmi3Slave):
|
|
5
|
+
|
|
6
|
+
default_experiment = DefaultExperiment(start_time=0)
|
|
7
|
+
|
|
8
|
+
def __init__(self, **kwargs):
|
|
9
|
+
super().__init__(**kwargs)
|
|
10
|
+
|
|
11
|
+
with (open(f'{self.resources}/hello.txt', 'r')) as file:
|
|
12
|
+
data = file.read()
|
|
13
|
+
|
|
14
|
+
self.time = 0
|
|
15
|
+
|
|
16
|
+
self.register_variable(Float64("time", causality=Fmi3Causality.independent, variability=Fmi3Variability.continuous))
|
|
17
|
+
self.register_variable(
|
|
18
|
+
String("file_content", getter=lambda: data,
|
|
19
|
+
causality=Fmi3Causality.output,
|
|
20
|
+
variability=Fmi3Variability.constant))
|
|
21
|
+
|
|
22
|
+
def do_step(self, current_time, step_size):
|
|
23
|
+
return True
|