Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PwCalculation: Fix restart validation for nscf/bands #905

Closed
mbercx opened this issue Apr 9, 2023 · 0 comments · Fixed by #906
Closed

PwCalculation: Fix restart validation for nscf/bands #905

mbercx opened this issue Apr 9, 2023 · 0 comments · Fixed by #906

Comments

@mbercx
Copy link
Member

mbercx commented Apr 9, 2023

The PwCalculation input validation checks that for nscf and bands calculations the restart_mode is not explicitly set to restart:

@staticmethod
def validate_inputs_base(value, _):
"""Validate the top level namespace."""
parameters = value['parameters'].get_dict()
calculation_type = parameters.get('CONTROL', {}).get('calculation', 'scf')
# Check that the restart input parameters are set correctly
if calculation_type in ('nscf', 'bands'):
if parameters.get('ELECTRONS', {}).get('startingpot', 'file') != 'file':
return f'`startingpot` should be set to `file` for a `{calculation_type}` calculation.'
if parameters.get('CONTROL', {}).get('restart_mode', 'from_scratch') != 'from_scratch':
warnings.warn(f'`restart_mode` should be set to `from_scratch` for a `{calculation_type}` calculation.')

However, setting restart_mode to restart is a valid use case for interrupted nscf and bands runs (see #902 (comment)). So this validation should be removed.

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

Successfully merging a pull request may close this issue.

1 participant