modelExchangeWithPassPythonObject
Test model for exchange function with memory
Extends from Modelica.Icons.Example (Icon for runnable examples).
Information
This example calls various functions in the Python module testFunctions.py.
It tests whether arguments and return values are passed correctly.
The functions in testFunctions.py are very simple in order to test
whether they compute correctly, and whether the data conversion between Modelica and
Python is implemented correctly.
Each call to Python is followed by an assert statement which terminates
the simulation if the return value is different from the expected value.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | passPythonObject | true | Set to true if the Python function returns and receives an object, see User's Guide |
| Real[1] | yR1 | Real function value | |
| Real[1] | yR2 | Real function value |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Buildings.Obsolete.Utilities.IO.Python_3_8.Functions.BaseClasses.PythonObject | pytObj | Buildings.Obsolete.Utilities.IO.Python_3_8.Functions.BaseClasses.PythonObject() |
Revisions
-
January 10, 2022, by Michael Wetter:
Updated to Python 3.8. -
December 11, 2021, by Michael Wetter:
Changed implementation to assigning parameters as opposed to variables because the assignment is made through impure function calls. This is for MSL 4.0.0. -
April 10, 2020, by Jianjun Hu and Michael Wetter:
Updated to Python 3.6. -
January 31, 2018, by Michael Wetter and Thierry Nouidui:
First implementation.