Skip to content

Restarting from a seed mechanism does not handle empty filters properly #1846

@amarkpayne

Description

@amarkpayne

Bug Description

Trying to restart from a seed mechanism throws the following error if the RMG job used to generate the seed mechanism did not use filtering:

Traceback (most recent call last):
  File "rmg.py", line 111, in <module>
    main()
  File "rmg.py", line 105, in main
    rmg.execute(**kwargs)
  File "rmgpy/rmg/main.py", line 649, in execute
    self.initialize(**kwargs)
  File "rmgpy/rmg/main.py", line 615, in initialize
    self.initialize_reaction_threshold_and_react_flags()
  File "rmgpy/rmg/main.py", line 1538, in initialize_reaction_threshold_and_react_flags
    unimolecular_threshold_restart = f.get('unimolecular_threshold').value
AttributeError: 'NoneType' object has no attribute 'value'

When designing the restart feature, we decided to handle this situation in a Try/Except block, where if the filters were missing we would assume the previous job did not use filtering, and set the current filters accordingly (see the code here). However, the Except block expects a KeyError to be thrown instead of an AttributeError.

How To Reproduce

Run the superminimal model to completion. Then, try restarting from the generated seed mechanism.

Additional Context

I should have this fixed up soon, along with some functional tests to help us catch errors like this.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions