Closed softwareengineerprogrammer closed 1 week ago
This looks fine. It seems the new rule is that comments start with "#". Can we update the input parameter line parsing code to check for lines that start with "#" and automatically ignore them, no matter what they contain? I ask for this because what I have noted in the past that if the comment lines contains commas, the parser will try to parse the line and will fail, producing an error. I went thru and removed all the commas in comments, but now if we use "#" to designate comments, we can have as many commas in the comments as we want if the parser code is updated to handle the new comment line delimiter. I suggest we try to maintain backward compatibility for comments that don't start with "#" as much as possible, with the caveat that those lines must not contain commas.
Good call @malcolm-dsider - Added test cases with a variety of comment styles, and discovered and fixed some edge cases in doing so.
Tests now verify that this input_comments.txt
is parsed/run correctly with no stray comments-as-parameters:
# comment
# foo, bar
# foo, bar, baz
# foo, bar, baz, qux corge
Gradient 1, 69
Reservoir Depth, 5, -- comment here
End-Use Option, 1, # another comment
Power Plant Type, 4, comments galore
# another, comment, with, commas, down here
# comment with space
# comment with space, and comma
# comment with space, and commas, plural?!
-- another comment style
--- three is not the charm, hopefully
**** A legacy-but-still-supported header comment style, indeed ****
*******************************************************************
You can see the new descriptions at https://gtp.scientificwebservices.com/geophires -> Examples tab