SPF-OST / pytrnsys

Package that provides functionality to run and process, plot and report TRNSYS simulations
https://pytrnsys.readthedocs.io
GNU General Public License v3.0
11 stars 8 forks source link

Allow keyword arguments in the interface to types. #174

Open ahobeost opened 8 months ago

ahobeost commented 8 months ago

As a user, I would like to minimize duplication and searching when dealing with the type interface. Currently, this is used as follows:

CONSTANTS 61
par1 = 1
par2 = 2
.....
EQUATIONS 60
input1 = var1
input2 = var2
.....
PARAMETERS 61
par1
par2
........
INPUTS 60
input1
input2
......
*** initial values
input1 input2 .....

With keywords this could be reduced to (in the ddck):

PARAMETERS 61
par1 = 1
par2 = 2
.....
INPUTS 60
input1 = [var1, 0]
input2 = [var2, 35]
.....

Notice the absence of the initial values. As the dck interface of trnsys doesn't change, this would require pytrnsys to identify the keywords being used, and to add them to a new set of CONSTANTS or EQUATIONS.

In this suggested behavior, the initial values would be read from the second entry in the brackets. inputName = [variableName, initialValue]