-
-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yaml2ck: Check if third body is in species list #1696
Conversation
Does not write the third body efficiencies for species that are not in the solution's species list Fixed Cantera#1683
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @corykinney. I think this looks like a clean fix. Could you please add a test to test_convert.py
verifying that this works as intended?
I didn't try it, but I think your patch would add a blank line to the output. I don't see a problem with that. |
- Converted species names to set comprehension, as suggested - Added phase definition from original issue for test - Implemented test to check that only the undeclared third body was omitted - Temperature and pressure conditions used for kinetics check matched to GRI 3.0 test function
@speth I implemented your suggestions and added the necessary test case. It should be good to go, but let me know if I missed anything in the test. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1696 +/- ##
==========================================
- Coverage 75.69% 75.69% -0.01%
==========================================
Files 443 443
Lines 60975 60971 -4
Branches 9551 9552 +1
==========================================
- Hits 46158 46154 -4
Misses 11786 11786
Partials 3031 3031 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @corykinney! This looks good to me.
Changes proposed in this pull request
This pull request adds a check in
yaml2ck
for third body efficiencies for species that might not be present in thect.Solution
object due to theskip-undeclared-third-bodies: true
flag.Closes #1683
Using the provided example from the issue referenced:
The outputted Chemkin file from
python -m cantera.yaml2ck test.yaml --overwrite
before the change:versus after the change:
The
N2
efficiency is omitted from the list as desired.Feedback
An example file still needs to be added with a corresponding test case, but before doing so, I wanted to solicit feedback on potential edge cases. What behavior would be expected if no explicit third body species are present in the mechanism? Are there any other possible cases that need to be accounted for proactively?
Checklist
scons build
&scons test
) and unit tests address code coverage