diff --git a/rmgpy/data/kinetics/family.py b/rmgpy/data/kinetics/family.py index 87f197251e..2268a57ca1 100644 --- a/rmgpy/data/kinetics/family.py +++ b/rmgpy/data/kinetics/family.py @@ -258,6 +258,7 @@ def get_reverse(self): other.add_action(['GAIN_PAIR', action[1], action[2]]) elif action[0] == 'GAIN_PAIR': other.add_action(['LOSE_PAIR', action[1], action[2]]) + other.actions = reversed(other.actions) # Play the reverse recipe in the reverse order return other def _apply(self, struct, forward, unique): @@ -1138,10 +1139,7 @@ def add_rules_from_training(self, thermo_database=None, train_indices=None): data = deepcopy(entry.data) data.change_t0(1) - if type(data) is Arrhenius: - # more specific than isinstance(data,Arrhenius) because we want to exclude inherited subclasses! - data = data.to_arrhenius_ep() - elif isinstance(data, StickingCoefficient): + if isinstance(data, StickingCoefficient): data = StickingCoefficientBEP( # todo: perhaps make a method StickingCoefficient.StickingCoefficientBEP # analogous to Arrhenius.to_arrhenius_ep @@ -1163,6 +1161,9 @@ def add_rules_from_training(self, thermo_database=None, train_indices=None): Tmin=deepcopy(data.Tmin), Tmax=deepcopy(data.Tmax) ) + elif type(data) is Arrhenius: + # more specific than isinstance(data,Arrhenius) because we want to exclude inherited subclasses! + data = data.to_arrhenius_ep() else: raise NotImplementedError("Unexpected training kinetics type {} for {}".format(type(data), entry)) diff --git a/rmgpy/reaction.py b/rmgpy/reaction.py index d4af192f66..64e96aa3da 100644 --- a/rmgpy/reaction.py +++ b/rmgpy/reaction.py @@ -683,7 +683,7 @@ def get_surface_rate_coefficient(self, T, surface_site_density): if isinstance(self.kinetics, SurfaceArrhenius): return self.kinetics.get_rate_coefficient(T, P=0) - raise NotImplementedError("Can't get_surface_rate_coefficient for kinetics type {!r}".format(type(self.kinetics))) + raise NotImplementedError("Can't get_surface_rate_coefficient for kinetics type {!r} and reaction {}".format(type(self.kinetics),self.to_labeled_str())) def fix_diffusion_limited_a_factor(self, T): """