Replies: 5 comments
-
Do you think we can allow arbitrary numbers of comment lines in separation sections? And perhaps randomly placed comment lines within a value/key list? I kind of like keeping the |
Beta Was this translation helpful? Give feedback.
-
I've talked with Emmanuel about this and like the proposal. With just a small changes to the existing input file formats, it will be much easier to develop scripts to read and write all input files, including for converting a model from one version of OpenFAST to another, and for generating all of the input files needed for a loads analysis or other batch analysis based on a master set of input files. |
Beta Was this translation helpful? Give feedback.
-
I was looking into the One really nice feature of it is that it provides the line number for each line of each file held in memory (this supports nested files with the |
Beta Was this translation helpful? Give feedback.
-
Sounds good to me to expand on As for comment characters, I don't have a strong opinion regarding |
Beta Was this translation helpful? Give feedback.
-
I've added a toy example/test here: https://github.com/ebranlard/openfast/tree/f/inputformat/test-input |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
Input files from openfast lack some strict "format specifications", the main issue being tables, "outlist" and comments.
Describe the solution you'd like
Transitioning to an existing file format such as yaml might require some important efforts, so I'm suggesting that we come up with some small adjustements of the current inputs files, to reach a level where we follow some fixed format specifications.
The main benefits would be:
Here's the format specifications I'm suggesting:
First line, starts with something like
#fileheader type:openfast format_version:3
(everything case incensitive, format version 2 corresponds to the current specification, version 3 to the ones I'm suggesting)Comments are indicated after the following markers:
['!', '#', '%', '---']
(the NWTC library uses['!#%']
for some functions. I'm not sure we should keep '%' or '#', but '---' at beginning of line is convenient for existing files)Lines with Value/Key pairs follow the format:
Value Key Comment
(space separated,Comment
does not require a comment character)Lines with ValueList /Key follow the format:
Value1 , Value2, Value3 Key Comment
(values should now be comma separated, the key follows the last item,Comment
does not require a comment character)Tables are indicated with a line of the following form:
#table key:value key2:value2 ..
where key is in['name','col','row','header','format']
(arbitrary order, case incensitive, space separated, and the only required parameter isrow
, the programmer may hardcode/override the other keys). The keyformat
is a string indicating the types of each column using one character, whereI=int , F=Float, B=boolean, S=String
.The following lines are the header lines (length given by the
header
key), then the table lines. Arbitrary text may be placed at the end of the columns. After reading, the programmer will receive an array for each data type as optional arguments.Outlist is indicated with a line starting with
#outlist
(case incensitive). Arbitrary text may follow on that line. The remaining lines until the keywordEND
are the output channels.Here's an tentative example of input file:
I've written these specifications such that limited changes would be required to the input files (and to the code) to switch to this format. I believe it would support the functionalities of most input files.
I've purposely kept it a bit "loose", with comment characters not required in some cases, but we can easily require this. Fortran also tends to treat space or comma separated fields similarly, but we can progressively make our reading functions more strict.
Let me know your thoughts, I'm happy to change any of these specifications based on your comments.
Beta Was this translation helpful? Give feedback.
All reactions