Open speth opened 8 months ago
@speth I'm interested in helping with this. After my initial reading of yaml2ck
, it looks like the snippets that might need to be modified are build_thermodynamics_text
:
and in build_transport_text
:
To insert !
s for every newline in the note, if applicable. Is that correct or am I missing anything?
Yeah, I think that would be the gist of it. If I recall correctly, there may also be handling for comments associated with each reaction which would need a similar fix.
I pushed a simple fix for the multi-line thermo notes and confirmed the roundtrip produces the exact same note in the YAML file.
@speth As for the transport, it seems to me that multi-line transport notes aren't really possible in the Chemkin format, as the notes are supposed to be appended to the end of the line, is that correct? Or at least if multi-line comments are allowed, it's not roundtripping with ck2yaml
, only the portion at the end of the line is retained.
Also, it seems to me that currently, yaml2ck
does not even write any notes to the Chemkin file for reactions, even if they are present in the YAML file, unless I'm mistaken. So I will go ahead and implement that with multi-line notes in mind so that roundtripping the files does not lose the comments.
Problem description
Multi-line
note
fields in thermo entries are not correctly converted to comment lines byyaml2ck
-- only the first line has a!
character added. This causes errors round-tripping thermo files if the original CK file contained commented-out species entries, which are then re-inserted without being marked as comments.Steps to reproduce
Use
yaml2ck
to convert a file containing the following species entry:Behavior
Resulting section of generated CK thermo file:
System information
Additional context
Discovered while investigating #1632.