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

Add variations to the ASSIGN functionality in the run.config #161

Open ahobeost opened 1 year ago

ahobeost commented 1 year ago

As a USER, the new ASSIGN functionality greatly simplifies adjusting which file is being read when repeating the same ddck in a project. Such simplicity does not yet exist, however, when doing variations on the input file.

For the case of a single ddck (not reused), one can currently:

  1. Create multiple config files, changing only the file that is being read. Then run the list of configs.
  2. Create multiple ddcks, changing only the file that is being read. Then use changeDdckFile variations.
  3. Prepare all files and associated logical units. Then use the variation to say which logical unit to read from (details below).

Case 2 is similar to the case for which DDCK AS and ASSIGN were original introduced.

For case 3, one could use something like: ddck entries:

unitReader1 = 1
unitReader2 = 2
unitReader3 = 3
...

ASSIGN "..\file1.csv" unitReader1
ASSIGN "..\file2.csv" unitReader2
ASSIGN "..\file3.csv" unitReader3
....

unitReaderUsed = unitReader1 

config usage: variation inputFileVariation unitReaderUsed unitReader1 unitReader2 unitReader3


It would be great if this could be simplified further. Maybe to something like (config only):

string FILE1$ "..\file1.csv"
string FILE2$ "..\file2.csv"
string FILE3$ "..\file3.csv"

changeAssign unitReader1 FILE1$ FILE2$ FILE3$

This latter option would then vary only the path of the given assign statement: ASSIGN "..\file1.csv" unitReader1