Conversation
|
Could you also add a test for a birad? |
|
|
||
| reactantNum = self.productNum | ||
|
|
||
| if self.autoGenerated and reactantNum != len(reactants): |
There was a problem hiding this comment.
Does it have to be autoGenerated for this to be a good check to do?
There was a problem hiding this comment.
Yes, because for non-autogenerated trees self.reactantNum seems to be guessed from the template number, which really only works for bimolecular families.
|
I think this looks fine overall. I agree that it would be good to add a test. |
Codecov Report
@@ Coverage Diff @@
## master #1675 +/- ##
=========================================
Coverage ? 41.55%
=========================================
Files ? 176
Lines ? 29837
Branches ? 6192
=========================================
Hits ? 12399
Misses ? 16530
Partials ? 908
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #1675 +/- ##
=========================================
Coverage ? 41.54%
=========================================
Files ? 176
Lines ? 29840
Branches ? 6192
=========================================
Hits ? 12398
Misses ? 16533
Partials ? 909
Continue to review full report at Codecov.
|
|
|
||
|
|
||
| def testReactantNumID(self): | ||
| family = self.database.families['R_Recombination'] |
rmgpy/data/kinetics/familyTest.py
Outdated
| spc = Molecule().fromSMILES("[CH2]CC[CH2]") | ||
| out = family._KineticsFamily__generateReactions(reactants=[spc],forward=True) | ||
| logging.error(out) | ||
| self.assertTrue(out==[]) |
rmgpy/data/kinetics/familyTest.py
Outdated
| family = self.database.families['R_Recombination'] | ||
| spc = Molecule().fromSMILES("[CH2]CC[CH2]") | ||
| out = family._KineticsFamily__generateReactions(reactants=[spc],forward=True) | ||
| logging.error(out) |
There was a problem hiding this comment.
I don't think you need to log this. If the assertion fails, it will print out the value.
Fixes #1674.