-
-
Notifications
You must be signed in to change notification settings - Fork 349
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
Fixed: Ck2yaml crashes if reaction equation has both ThreeBodyReaction and Falloff reaction types #855
Conversation
Codecov Report
@@ Coverage Diff @@
## master #855 +/- ##
=======================================
Coverage 71.40% 71.40%
=======================================
Files 372 372
Lines 43605 43605
=======================================
Hits 31134 31134
Misses 12471 12471 Continue to review full report at Codecov.
|
Hi @tsikes! Thanks for sending this. I'd like to ask for two small changes before we can merge this:
Thanks! |
@bryanwweber I changed the title to be more descriptive. I'll be happy to add some tests if you can give me a bit of guidance. Also, I have never used scons, so I've not done either of those checks. |
Hi @tsikes! Thanks for the quick reply. I actually meant the commit message summary. You can edit the commit message by typing For the test, I think adding a pair of reactions in the CHEMKIN input file format like those in #800 to a new file in the def test_third_body_plus_m_reactions(self):
self.convert('your-input-file-name.inp', thermo='dummy-thermo.dat')
gas = ct.Solution('your-input-file-name' + self.ext)
self.assertEqual(gas.n_reactions, 2) after the function For your other fix, you can add a minimized version of the file that lead you to make that change into We run the tests here on our continuous integration, so you don't need to run |
Hi @bryanwweber. I think I got everything you needed. I made 2 tests that failed previously, but now succeed in the patched ck2yaml. I squashed the commits into 1 and changed the commit summary message. |
If I made a change in how ck2yaml reads in NASA7 notes, would it be appropriate to combine that with the above changes or should I make another PR? Previously all spacing was destroyed because the species name + notes were split and stripped. I instead changed it so that they only split at the first space instead of any space. |
@tsikes I think a new PR would be better |
…n and Falloff reaction types Bug: check_duplicate_reactions breaks if sent a third body reaction and falloff reaction because r1.third_body (or r2) is None and has no attribute upper. Fix: This changes the third body reaction type to have a .third_body of M and then in check_duplicate_reactions check that r1 and r2 are not a mixture of three body reaction type and something else. Bug: if blank space in header, parser crashes due to regular expression search to determine indent size Fix: check that the comment is not empty before trying to determine indent size Improvement: inform user which reaction contains multiple reaction types Added Tests for both issues fixed
@tsikes Thanks for the updates! I pushed a few small changes here, removing some spaces at the ends of lines, converting tabs to spaces, and making sure all the files ended with a blank line. Nothing substantive though, just some nitpicky stuff to keep all our files consistent. Once the tests pass, I'll merge the PR (probably in the morning EDT). Thanks again for your work here! |
Thank you for submitting this @tsikes! |
I'm glad I could help! |
Bug: check_duplicate_reactions breaks if sent a third body reaction and falloff reaction because r1.third_body (or r2) is None and has no attribute upper.
Fix: This changes the third body reaction type to have a .third_body of M and then in check_duplicate_reactions check that r1 and r2 are not a mixture of three body reaction type and something else.
Bug: if blank space in header, parser crashes due to regular expression search (for indent size) to return None and not have start attribute
Fix: check that the comment is not empty before trying to determine indent size
Improvement: inform user which reaction contains multiple reaction types
Checklist
scons build
&scons test
) and unit tests address code coverageFixes #800
Changes proposed in this pull request