SPF-OST / pytrnsys_gui

Graphical user interface for pytrnsys
https://pytrnsys.readthedocs.io
GNU Lesser General Public License v3.0
3 stars 4 forks source link

Create `head.ddck` from template by injecting python constants #462

Open zuckerruebe opened 1 year ago

zuckerruebe commented 1 year ago

In trnsysGUI/massFlowSolver/names.py the following "global" variable names are defined

ABSOLUTE_TOLERANCE_NAME = "mfrSolverAbsTol"
RELATIVE_TOLERANCE_NAME = "mfrSolverRelTol"
TOLERANCE_SWITCHING_THRESHOLD_NAME = "mfrTolSwitchThreshold"

with the understanding that they are defined in head.ddck. That means that those two places need to be kept in sync. As a developer, I'd prefer for them to only be defined in one place in order to minimize the risk of forgetting to update them. Hence, the head.ddck should be created from a template file by injecting the names defined in Python into it. This needs to happen when we build the Python package, as we'd like to distribute a "compiled" head.ddck to our users. What this means for a developer install (i.e. install from source via git and PyCharm, e.g.) needs to be investigated.