ezpzbz / aiida-catmat

Collection of AiiDA WorkChains Developed in CATMAT project
MIT License
3 stars 1 forks source link

[BUG] popping non existent dictionary key #61

Closed ezpzbz closed 3 years ago

ezpzbz commented 3 years ago

context

If structure needs to be sorted due to the change of signs in magnetic ordering, we do remove restart folder from inputs to restart the calculation from scratch in: https://github.com/morgan-group-bath/aiida-bjm/blob/89120e5f348d45ca75cb61d7dde02291b21ecdce/aiida_bjm/workchains/vasp_multistage.py#L401

It was not causing error as we were updating the current structure only after getting converged structure in production relax run. Now, it has been slightly changed and we update the structure even after short intial relaxation (which has not faced any error). Therefore, we may hit the should_sort_structure berfore assigning any restart folder. Consequently, it will raise KeyError as there is no restart_folder there.

solution

It has to be changed to:

self.ctx['vasp_base']['vasp'].pop('restart_folder', None)