Skip to content

Commit

Permalink
Fix resubmit_unconverged_geometry handler. (#116)
Browse files Browse the repository at this point in the history
Currently, an AiiDA Dict object defined as follows:
```
d = Dict(dict={'a':{'b':1}})
```
Returns two type of errors if the key isn't present:
- `d['x']` returns `AttributeError`
- `d['a']['x'] returns `KeyError`

This PR adapts the `resubmit_unconverged_geometry` handler to
this behaviour.
  • Loading branch information
yakutovicha committed Oct 16, 2020
1 parent 0c3c3aa commit a5f26ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aiida_cp2k/workchains/base.py
Expand Up @@ -74,7 +74,7 @@ def resubmit_unconverged_geometry(self, calc):
params = add_restart_sections(params)

# If not all the restart keys are present, adding them to the input dictionary
except KeyError:
except (AttributeError, KeyError):
params = add_restart_sections(params)

# Might be able to solve the problem
Expand Down

0 comments on commit a5f26ff

Please sign in to comment.