Detect description in cti2yaml#1205
Conversation
933779a to
938ee7d
Compare
de779ee to
4f71812
Compare
5467fc2 to
6d240f5
Compare
|
@bryanwweber … I am marking this as ready for review despite some mysterious test failures. As far as I can tell, a Boolean flag is not being passed correctly from the test suite. The ‘interesting’ part is that failures are not repeatable (different runners either pass or fail), and the code itself works as intended. I am stumped … |
bryanwweber
left a comment
There was a problem hiding this comment.
As I said below, I don't think adding the description to the output needs to be configurable. I find the option name confusing and anyways, it might resolve the test failures 😄
6d240f5 to
bbbe3ff
Compare
LiC6_electrodebulk.yaml was the only file in data/sample-data. Moving this file to samples/data mimics the input file location for the jupyter repository.
bbbe3ff to
8722780
Compare
|
@bryanwweber ... thanks for the suggestions! Omitting the configuration option indeed resolved the pipeline failures (although I still don't know why they happened in the first place). |
70ed3d9 to
dbf5175
Compare
dbf5175 to
faf6eaf
Compare
bryanwweber
left a comment
There was a problem hiding this comment.
Thanks @ischoegl A few more changes here. The main ones are the file encoding and multiple blank lines.
If we're deciding not to collect other comment blocks with this PR (which I think is fine) then this shouldn't close the enhancements issue. I think there is still value in attempting to extract those, even if only to try and insert them somewhere in the YAML as a comment, not an actual field. Likewise, I think it's worth trying to do something similar for CTML, which should actually be easier since lxml keeps comment tags.
| except ImportError: | ||
| print("WARNING: Unable to import Cantera Python module. ") | ||
| print("Output mechanism has not been validated") | ||
| sys.exit(0) |
There was a problem hiding this comment.
This is perhaps mirroring some other code, but I suspect that sys.exit(1) here would be more appropriate? Also, printing to sys.stderr?
There was a problem hiding this comment.
Other than not using logger, this is exactly equivalent to what ck2yaml does; as the script could be run without cantera installed on purpose, I think that may have been a deliberate choice. (Aside: ck2yaml prints a single line, which is now also adopted.)
faf6eaf to
72d58e4
Compare
72d58e4 to
f94d08c
Compare
|
@bryanwweber ... thank you for the review! I believe everything is addressed. Regarding the
I have no issue keeping it open 😃 |
Changes proposed in this pull request
ck2yaml)Further:
data/sample-datatosample/dataIf applicable, fill in the issue number this pull request is fixing
Partially addresses Cantera/enhancements#22 and Cantera/enhancements#23
If applicable, provide an example illustrating new features this pull request is introducing
(after also checking interface phases, this actually fails, see #1210). Or (using the same options already in place for
ck2yaml)The description is detected and available ...
(note that the odd indent for 'Reference' is preserved from the CTI file pulled verbatim from Cantera 2.5.1)
Checklist
scons build&scons test) and unit tests address code coverageOther thoughts
I spot-checked old XML input from 2.5 and there were only two instances where a comment was used, so I do not believe that this capability has to be added to XML (which is usually generated via
ctml_writeranyways).