pythonfmu3 0.1.11__tar.gz → 0.1.12__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.11/pythonfmu3.egg-info → pythonfmu3-0.1.12}/PKG-INFO +4 -2
- pythonfmu3-0.1.12/pythonfmu3/_version.py +1 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/fmi3slave.py +3 -2
- pythonfmu3-0.1.12/pythonfmu3/resources/binaries/x86_64-linux/libpythonfmu-export.so +0 -0
- pythonfmu3-0.1.12/pythonfmu3/resources/binaries/x86_64-windows/pythonfmu-export.dll +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/variables.py +15 -1
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12/pythonfmu3.egg-info}/PKG-INFO +4 -2
- pythonfmu3-0.1.11/pythonfmu3/_version.py +0 -1
- pythonfmu3-0.1.11/pythonfmu3/resources/binaries/x86_64-linux/libpythonfmu-export.so +0 -0
- pythonfmu3-0.1.11/pythonfmu3/resources/binaries/x86_64-windows/pythonfmu-export.dll +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/LICENSE +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/MANIFEST.in +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/README.md +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/__init__.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/__main__.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/builder.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/default_experiment.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/deploy.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/enums.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/logmsg.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/osutil.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/.clang-format +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/CMakeLists.txt +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/build_unix.sh +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/build_win.sh +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/src/CMakeLists.txt +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/src/cppfmu/cppfmu_common.hpp +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/src/cppfmu/cppfmu_cs.cpp +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/src/cppfmu/cppfmu_cs.hpp +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/src/cppfmu/fmi_functions.cpp +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/src/fmi/fmi3FunctionTypes.h +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/src/fmi/fmi3Functions.h +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/src/fmi/fmi3PlatformTypes.h +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/src/pythonfmu/PySlaveInstance.cpp +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/src/pythonfmu/PySlaveInstance.hpp +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/src/pythonfmu/PyState.hpp +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/tests/__init__.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/tests/conftest.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/tests/data/csvdemo.csv +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/tests/data/hello.txt +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/tests/slaves/PythonSlaveWithException.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/tests/slaves/localmodule.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/tests/slaves/pythonslave.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/tests/slaves/pythonslave_read_file.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/tests/slaves/slavewithdep.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/tests/test_builder.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/tests/test_deploy.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/tests/test_fmi3slave.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/tests/test_integration.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/tests/test_logger.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/tests/test_multiple_fmus.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/tests/test_variables.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/tests/utils.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/unit.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/variable_types.py +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3.egg-info/SOURCES.txt +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3.egg-info/dependency_links.txt +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3.egg-info/entry_points.txt +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3.egg-info/not-zip-safe +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3.egg-info/requires.txt +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3.egg-info/top_level.txt +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/setup.cfg +0 -0
- {pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pythonfmu3
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.12
|
|
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
|
|
@@ -19,8 +19,10 @@ Classifier: Programming Language :: Python :: 3.7
|
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.8
|
|
20
20
|
Classifier: Topic :: Scientific/Engineering
|
|
21
21
|
Description-Content-Type: text/markdown
|
|
22
|
-
Provides-Extra: tests
|
|
23
22
|
License-File: LICENSE
|
|
23
|
+
Provides-Extra: tests
|
|
24
|
+
Requires-Dist: pytest; extra == "tests"
|
|
25
|
+
Requires-Dist: fmpy; extra == "tests"
|
|
24
26
|
|
|
25
27
|
# PythonFMU3
|
|
26
28
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.12"
|
|
@@ -55,6 +55,7 @@ class Fmi3Slave(ABC):
|
|
|
55
55
|
self.modelName: Optional[str] = self.__class__.__name__
|
|
56
56
|
self.description: Optional[str] = None
|
|
57
57
|
self.default_experiment: Optional[DefaultExperiment] = None
|
|
58
|
+
|
|
58
59
|
self.type_definitions: Dict[str, VariableType] = {}
|
|
59
60
|
self.units: Dict[str, Unit] = {}
|
|
60
61
|
|
|
@@ -187,7 +188,7 @@ class Fmi3Slave(ABC):
|
|
|
187
188
|
raise Exception(f"Unsupported type {type(var)}!")
|
|
188
189
|
var.start = refs if len(getattr(var, "dimensions", [])) > 0 else refs[0]
|
|
189
190
|
|
|
190
|
-
def register_variable(self, var: ModelVariable, nested: bool = True, var_type: Any = None):
|
|
191
|
+
def register_variable(self, var: ModelVariable, nested: bool = True, units: str = "", var_type: Any = None):
|
|
191
192
|
"""Register a variable as FMU interface.
|
|
192
193
|
|
|
193
194
|
Args:
|
|
@@ -223,7 +224,7 @@ class Fmi3Slave(ABC):
|
|
|
223
224
|
def setup_experiment(self, start_time: float):
|
|
224
225
|
pass
|
|
225
226
|
|
|
226
|
-
def
|
|
227
|
+
def register_units(self, units: List[Unit]):
|
|
227
228
|
for unit in units:
|
|
228
229
|
self.units[unit.name] = unit
|
|
229
230
|
|
|
Binary file
|
|
Binary file
|
|
@@ -158,10 +158,11 @@ class Dimension(object):
|
|
|
158
158
|
return ele
|
|
159
159
|
|
|
160
160
|
class Float64(ModelVariable):
|
|
161
|
-
def __init__(self, name: str, start: Optional[Any] = None, derivative: Optional[Any] = None, dimensions: List[Dimension] = [], **kwargs):
|
|
161
|
+
def __init__(self, name: str, start: Optional[Any] = None, derivative: Optional[Any] = None, dimensions: List[Dimension] = [], unit: Optional[str] = None, **kwargs):
|
|
162
162
|
super().__init__(name, **kwargs)
|
|
163
163
|
self.__attrs = {"start": start, "derivative": derivative}
|
|
164
164
|
self._type = "Float64"
|
|
165
|
+
self._unit = unit
|
|
165
166
|
if dimensions:
|
|
166
167
|
check_numpy()
|
|
167
168
|
self.__dimensions = dimensions
|
|
@@ -173,6 +174,14 @@ class Float64(ModelVariable):
|
|
|
173
174
|
@start.setter
|
|
174
175
|
def start(self, value: float):
|
|
175
176
|
self.__attrs["start"] = value
|
|
177
|
+
|
|
178
|
+
@property
|
|
179
|
+
def unit(self) -> Optional[Any]:
|
|
180
|
+
return self._unit
|
|
181
|
+
|
|
182
|
+
@unit.setter
|
|
183
|
+
def unit(self, value: str):
|
|
184
|
+
self._unit = value
|
|
176
185
|
|
|
177
186
|
@property
|
|
178
187
|
def derivative(self):
|
|
@@ -182,6 +191,7 @@ class Float64(ModelVariable):
|
|
|
182
191
|
def dimensions(self) -> List[Dimension]:
|
|
183
192
|
return self.__dimensions
|
|
184
193
|
|
|
194
|
+
|
|
185
195
|
def to_xml(self) -> Element:
|
|
186
196
|
attrib = dict()
|
|
187
197
|
for key, value in self.__attrs.items():
|
|
@@ -194,6 +204,10 @@ class Float64(ModelVariable):
|
|
|
194
204
|
else:
|
|
195
205
|
output = f"{value:.16g}"
|
|
196
206
|
attrib[key] = output
|
|
207
|
+
|
|
208
|
+
if self.unit:
|
|
209
|
+
attrib["unit"] = self.unit
|
|
210
|
+
|
|
197
211
|
self._extras = attrib
|
|
198
212
|
parent = super().to_xml()
|
|
199
213
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pythonfmu3
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.12
|
|
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
|
|
@@ -19,8 +19,10 @@ Classifier: Programming Language :: Python :: 3.7
|
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.8
|
|
20
20
|
Classifier: Topic :: Scientific/Engineering
|
|
21
21
|
Description-Content-Type: text/markdown
|
|
22
|
-
Provides-Extra: tests
|
|
23
22
|
License-File: LICENSE
|
|
23
|
+
Provides-Extra: tests
|
|
24
|
+
Requires-Dist: pytest; extra == "tests"
|
|
25
|
+
Requires-Dist: fmpy; extra == "tests"
|
|
24
26
|
|
|
25
27
|
# PythonFMU3
|
|
26
28
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.11"
|
|
Binary file
|
|
Binary file
|
|
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
|
{pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/src/cppfmu/cppfmu_common.hpp
RENAMED
|
File without changes
|
{pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/src/cppfmu/cppfmu_cs.cpp
RENAMED
|
File without changes
|
{pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/src/cppfmu/cppfmu_cs.hpp
RENAMED
|
File without changes
|
{pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/src/cppfmu/fmi_functions.cpp
RENAMED
|
File without changes
|
{pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/src/fmi/fmi3FunctionTypes.h
RENAMED
|
File without changes
|
|
File without changes
|
{pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/pythonfmu3/pythonfmu-export/src/fmi/fmi3PlatformTypes.h
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pythonfmu3-0.1.11 → pythonfmu3-0.1.12}/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
|