Skip to content

Instantly share code, notes, and snippets.

@nickvandewiele
Last active August 29, 2015 14:21
Show Gist options
  • Save nickvandewiele/00fded046ea086a66c13 to your computer and use it in GitHub Desktop.
Save nickvandewiele/00fded046ea086a66c13 to your computer and use it in GitHub Desktop.
Testing the random way of sorting reactants of reaction when calling Reaction.reactants.sort()
import cPickle
from rmgpy.species import Species
from rmgpy.reaction import Reaction
a = Species(...)
b = Species(...)
r = Reaction()
r.reactants = [a,b]
r.reactants.sort()
r_pickle = cPickle.loads(cPickle.dumps(r))
r_pickle.reactants.sort()
for spc, spc_pickle in zip(r.reactants, r_pickle.reactants):
assert.assertTrue(spc.isIsomorphic(spc_pickle)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment