@@ -77,7 +77,7 @@ class TemplateReaction(Reaction):
7777 Attribute Type Description
7878 =============== ========================= =====================================
7979 `family` ``str`` The kinetics family that the reaction was created from.
80- `estimator` ``str`` Whether the kinetics came from rate rules or group additivity .
80+ `estimator` ``str`` The name of the kinetic estimator; currently only rate rules is supported .
8181 `reverse` :class:`TemplateReaction` The reverse reaction, for families that are their own reverse.
8282 `is_forward` ``bool`` Whether the reaction was generated in the forward direction of the family.
8383 `labeled_atoms` ``dict`` Keys are 'reactants' or 'products', values are dictionaries.
@@ -2396,23 +2396,20 @@ def get_reaction_template(self, reaction):
23962396 def get_kinetics_for_template (self , template , degeneracy = 1 , method = 'rate rules' ):
23972397 """
23982398 Return an estimate of the kinetics for a reaction with the given
2399- `template` and reaction-path `degeneracy`. There are two possible methods
2400- to use: 'group additivity' (new possible RMG-Py behavior) and 'rate rules' (old
2401- RMG-Java behavior, and default RMG-Py behavior).
2399+ `template` and reaction-path `degeneracy`. There is currently only one method to use:
2400+ 'rate rules' (old RMG-Java behavior, and default RMG-Py behavior). Group additivity was removed in August 2023.
24022401
24032402 Returns a tuple (kinetics, entry):
24042403 If it's estimated via 'rate rules' and an exact match is found in the tree,
24052404 then the entry is returned as the second element of the tuple.
2406- But if an average is used, or the 'group additivity' method, then the tuple
2407- returned is (kinetics, None).
2405+ But if an average is used, then the tuple returned is (kinetics, None).
2406+
24082407 """
2409- if method .lower () == 'group additivity' :
2410- return self .estimate_kinetics_using_group_additivity (template , degeneracy ), None
2411- elif method .lower () == 'rate rules' :
2408+ if method .lower () == 'rate rules' :
24122409 return self .estimate_kinetics_using_rate_rules (template , degeneracy ) # This returns kinetics and entry data
24132410 else :
24142411 raise ValueError ('Invalid value "{0}" for method parameter; '
2415- 'should be "group additivity" or " rate rules".' .format (method ))
2412+ 'currently only " rate rules" is supported .' .format (method ))
24162413
24172414 def get_kinetics_from_depository (self , depository , reaction , template , degeneracy ):
24182415 """
@@ -2458,8 +2455,8 @@ def _select_best_kinetics(self, kinetics_list):
24582455 def get_kinetics (self , reaction , template_labels , degeneracy = 1 , estimator = '' , return_all_kinetics = True ):
24592456 """
24602457 Return the kinetics for the given `reaction` by searching the various
2461- depositories as well as generating a result using the user-specified `estimator`
2462- of either 'group additivity' or 'rate rules' . Unlike
2458+ depositories as well as generating a result using the user-specified `estimator`.
2459+ Currently, only 'rate rules' is a supported estimator . Unlike
24632460 the regular :meth:`get_kinetics()` method, this returns a list of
24642461 results, with each result comprising of
24652462
@@ -2468,7 +2465,7 @@ def get_kinetics(self, reaction, template_labels, degeneracy=1, estimator='', re
24682465 3. the entry - this will be `None` if from a template estimate
24692466 4. is_forward a boolean denoting whether the matched entry is in the same
24702467 direction as the inputted reaction. This will always be True if using
2471- rates rules or group additivity . This can be `True` or `False` if using
2468+ rates rules. This can be `True` or `False` if using
24722469 a depository
24732470
24742471 If return_all_kinetics==False, only the first (best?) matching kinetics is returned.
@@ -2489,7 +2486,9 @@ def get_kinetics(self, reaction, template_labels, degeneracy=1, estimator='', re
24892486 for kinetics , entry , is_forward in kinetics_list0 :
24902487 kinetics_list .append ([kinetics , depository , entry , is_forward ])
24912488
2492- # If estimator type of rate rules or group additivity is given, retrieve the kinetics.
2489+ # If estimator type of rate rules is given, retrieve the kinetics.
2490+ # TODO: Since group additivity was removed, this logic can be condensed into just 1 branch.
2491+
24932492 if estimator :
24942493 try :
24952494 kinetics , entry = self .get_kinetics_for_template (template , degeneracy , method = estimator )
@@ -2502,7 +2501,6 @@ def get_kinetics(self, reaction, template_labels, degeneracy=1, estimator='', re
25022501 return kinetics , estimator , entry , True
25032502 kinetics_list .append ([kinetics , estimator , entry , True ])
25042503 # If no estimation method was given, prioritize rate rule estimation.
2505- # If returning all kinetics, add estimations from both rate rules and group additivity.
25062504 else :
25072505 try :
25082506 kinetics , entry = self .get_kinetics_for_template (template , degeneracy , method = 'rate rules' )
@@ -2513,15 +2511,6 @@ def get_kinetics(self, reaction, template_labels, degeneracy=1, estimator='', re
25132511 # If kinetics were undeterminable for rate rules estimation, do nothing.
25142512 pass
25152513
2516- try :
2517- kinetics2 , entry2 = self .get_kinetics_for_template (template , degeneracy , method = 'group additivity' )
2518- if not return_all_kinetics :
2519- return kinetics2 , 'group additivity' , entry2 , True
2520- kinetics_list .append ([kinetics2 , 'group additivity' , entry2 , True ])
2521- except KineticsError :
2522- # If kinetics were undeterminable for group additivity estimation, do nothing.
2523- pass
2524-
25252514 if not return_all_kinetics :
25262515 raise UndeterminableKineticsError (reaction )
25272516
@@ -3599,8 +3588,6 @@ def cross_validate_old(self, folds=5, T=1000.0, random_state=1, estimator='rate
35993588 template = self .retrieve_template (template_labels )
36003589 if estimator == 'rate rules' :
36013590 kinetics , entry = self .estimate_kinetics_using_rate_rules (template , degeneracy = 1 )
3602- elif estimator == 'group additivity' :
3603- kinetics = self .estimate_kinetics_using_group_additivity (template , degeneracy = 1 )
36043591 else :
36053592 raise ValueError ('{0} is not a valid value for input `estimator`' .format (estimator ))
36063593
0 commit comments