Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions rmgpy/data/kinetics/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand All @@ -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))

Expand Down
2 changes: 1 addition & 1 deletion rmgpy/reaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down