File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232
3333logger = get_logger ()
3434
35+ MAX_IRC_FRAGMENTS_FOR_CHARGE_SEARCH = 4
3536LOWEST_MAJOR_TS_FREQ , HIGHEST_MAJOR_TS_FREQ = settings ['LOWEST_MAJOR_TS_FREQ' ], settings ['HIGHEST_MAJOR_TS_FREQ' ]
3637
3738
@@ -612,8 +613,7 @@ def _perceive_irc_fragments(xyz: dict,
612613 return [mol ] if mol is not None else None
613614
614615 # Prefer splits that minimize the total absolute charge (e.g., 0,0 over +1,-1).
615- # Cap at 4 fragments to keep the combinatorial search bounded
616- if n_frags > 4 :
616+ if n_frags > MAX_IRC_FRAGMENTS_FOR_CHARGE_SEARCH :
617617 return None
618618 max_abs_charge = max (2 , abs (charge ) + 1 )
619619 charge_range = range (- max_abs_charge , max_abs_charge + 1 )
@@ -660,6 +660,10 @@ def _match_fragments_to_species(fragments: List['Molecule'],
660660 return False
661661 if n == 0 :
662662 return True
663+ frag_formulas = sorted (frag .get_formula () for frag in fragments )
664+ expected_formulas = sorted (mol .get_formula () for mol in expected_mols )
665+ if frag_formulas != expected_formulas :
666+ return False
663667 if n == 1 :
664668 return check_isomorphism (fragments [0 ], expected_mols [0 ])
665669 iso_matrix = [[check_isomorphism (fragments [i ], expected_mols [j ]) for j in range (n )] for i in range (n )]
You can’t perform that action at this time.
0 commit comments