Skip to content

Commit e49e127

Browse files
rwestsevyharris
andcommitted
Allow comment parsing to not die from "in family __" comment.
It doesn't actually _parse_ the new comment to figure out what family the thing comes from, but in most contexts it is not needed. At least now it doesn't crash. Also added the new phrase to at least one item in the testing examples so the unit tests could catch this. Co-authored-by: Richard West <r.west@northeastern.edu> Co-authored-by: Sevy Harris <sevy.harris@gmail.com>
1 parent be23bcf commit e49e127

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

rmgpy/data/kinetics/family.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4487,6 +4487,7 @@ def extract_source_from_comments(self, reaction):
44874487
template_matches = re.search(template_pattern, full_comment_string)
44884488
if autogen_node_matches is not None: # autogenerated trees
44894489
template_str = autogen_node_matches.group(1).split('Multiplied by reaction path degeneracy')[0].strip()
4490+
template_str = template_str.split('in family')[0].strip()
44904491
tokens = template_str.split()
44914492
if len(tokens) == 2: # The node was probably split because wordwrap was turned off
44924493
assert len(template_str) > 115, 'The node name is too short to have been broken up by the chemkin writer'

test/rmgpy/test_data/parsing_data/chem_annotated.inp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ HCCO(23)(+M)=O(2)+C2H(21)(+M) 1.000e+00 0.000 0.000
259259
! Reaction index: Chemkin #25; RMG #97
260260
! Template reaction: Disproportionation
261261
! Flux pairs: CH3CHCH3, C3H6(28); C2H5(27), C2H6;
262-
! Estimated from node Root_Ext-2R!H-R_2R!H->C_4R->C
262+
! Estimated from node Root_Ext-2R!H-R_2R!H->C_4R->C in family Disproportionation.
263263
! Multiplied by reaction path degeneracy 6.0
264264
C2H5(27)+CH3CHCH3<=>C2H6+C3H6(28) 3.000e+11 0.000 0.000
265265

0 commit comments

Comments
 (0)