Skip to content

Can't load restart - pickling problems? #114

Description

@rwest

I am getting this when I try to restart the methylformate example:

  File "/nics/d/home/rwest/Code/RMG-Py/rmgpy/rmg/main.py", line 291, in initialize
    self.loadRestartFile(os.path.join(self.outputDirectory,'restart.pkl'))
  File "/nics/d/home/rwest/Code/RMG-Py/rmgpy/rmg/main.py", line 589, in loadRestartFile
    self.reactionModel = cPickle.load(f)
  File "quantity.py", line 275, in rmgpy.quantity.ArrayQuantity.__init__ (build/pyrex/rmgpy/quantity.c:4503)
rmgpy.quantity.QuantityError: (QuantityError('Dimension 0 has 7 elements for the given value, but 3 elements for the given uncertainty.',), <type 'rmgpy.quantity.ArrayQuantity'>, (array([  750.        ,   770.        ,  3400.        ,  2100.        ,
         647.28325342,   647.28380352,  3592.16637415]), 'cm^-1', array([ 0.,  0.,  0.]), '+|-'))

I'm not sure what the offending object is, but it's something with units of cm^-1. I'm guessing vibrational frequencies (first four integer ones from Franklin's groups, last 3 floats from fitting to the Cp). Not sure why it only has 3 uncertainties (that are all zero!).

Do we have a unit test on pickling and unpickling of frequencies?

Activity

  1. rwest commented on Apr 21, 2013

    @rwest
    MemberAuthor

    I think this particular problem is addressed by d8b38a0
    (When the extra frequencies were being estimated, the frequencies' value_si array was extended but its uncertainty array was not).
    But so far nothing has been done to check for other errors of this type (eg. a check on set for value or value_si)

  2. rwest commented on Apr 21, 2013

    @rwest
    MemberAuthor

    The above commit does indeed solve the loading from restart problem, but now immediately after loading we fail to save the HTML output:

    Loading previous restart file...
    Saving current model to HTML file...

    Stack trace:

      File "/nics/d/home/rwest/Code/RMG-Py/rmgpy/rmg/main.py", line 361, in execute
        self.saveEverything()
      File "/nics/d/home/rwest/Code/RMG-Py/rmgpy/rmg/main.py", line 517, in saveEverything
        self.saveOutputHTML()
      File "/nics/d/home/rwest/Code/RMG-Py/rmgpy/rmg/main.py", line 658, in saveOutputHTML
        saveOutputHTML(os.path.join(self.outputDirectory, 'output.html'), self.reactionModel)
      File "/nics/d/home/rwest/Code/RMG-Py/rmgpy/rmg/output.py", line 113, in saveOutputHTML
        family = rxn.getSource().label
    AttributeError: 'rmgpy.reaction.Reaction' object has no attribute 'getSource'

    Seems we can't save reactions that came from a restart? Is the source being pickled correctly?

  3. jwallen commented on Apr 21, 2013

    @jwallen
    Contributor

    The source depends on the type of reaction being saved. I think in this case it's rmgpy.rmg.pdep.PDepReaction that is the issue; it is missing a specialized __reduce__() method, so it's using the one from the base class, which doesn't know how to save the source.

  4. rwest commented on Apr 21, 2013

    @rwest
    MemberAuthor

    Thanks. Fixed in 60ed251.

    ..although a unit test would be nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions