Skip to content

Commit

Permalink
Add __reduce__ method to rmgpy.rmg.pdep.RDepReaction (for pickling).
Browse files Browse the repository at this point in the history
Hopefully closes #114
  • Loading branch information
rwest committed Apr 21, 2013
1 parent 7e83b79 commit 60ed251
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion rmgpy/rmg/pdep.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ class PDepReaction(rmgpy.reaction.Reaction):
def __init__(self, index=-1, label='', reactants=None, products=None, network=None, kinetics=None, reversible=True, transitionState=None, duplicate=False, degeneracy=1, pairs=None):
rmgpy.reaction.Reaction.__init__(self, index, label, reactants, products, kinetics, reversible, transitionState, duplicate, degeneracy, pairs)
self.network = network


def __reduce__(self):
"""
A helper function used when pickling an object.
"""
return (PDepReaction, (self.index, self.label, self.reactants, self.products, self.network, self.kinetics, self.reversible, self.transitionState, self.duplicate, self.degeneracy, self.pairs))

def getSource(self):
"""
Get the source of this PDepReaction
Expand Down

0 comments on commit 60ed251

Please sign in to comment.