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
PwRelaxWorkChain
: replace relaxation_scheme
with relax_type
#614
Conversation
f1558ad
to
5e28af0
Compare
5e28af0
to
66c565d
Compare
@mbercx this is ready for review now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sphuber! Just have a few minor comments/questions.
elif self.inputs.relaxation_scheme.value == 'vc-relax': | ||
relax_type = RelaxType.ATOMS_CELL | ||
else: | ||
raise ValueError('insupported value for the `relaxation_scheme` input.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise ValueError('insupported value for the `relaxation_scheme` input.') | |
raise ValueError('unsupported value for the `relaxation_scheme` input.') |
help='The relaxation scheme to use: choose either `relax` or `vc-relax` for variable cell relax.') | ||
spec.input('relax_type', valid_type=orm.Str, default=lambda: orm.Str(RelaxType.ATOMS_CELL), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we change this to:
spec.input('relax_type', valid_type=orm.Str, default=lambda: orm.Str(RelaxType.ATOMS_CELL), | |
spec.input('relax_type', valid_type=orm.Str, default=lambda: orm.Str(RelaxType.ATOMS_CELL.value), |
Since:
In [1]: from aiida_quantumespresso.common.types import RelaxType
In [2]: from aiida_quantumespresso.workflows.pw.relax import validate_relax_type
In [3]: validate_relax_type(Str(RelaxType.ATOMS_CELL), None)
Out[3]: '`RelaxType.ATOMS_CELL` is not a valid value of `RelaxType`.'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes we should
The `relaxation_scheme` was used to communicate the type of relaxation to be performed and accepted either `relax` or `vc-relax`, directly modeled after the relax options that could be passed to the `CONTROL.calculation` input parameter. There are, however, many other relax modes possible, such as those constraining parts of the degree of freedom of the cell. To support these a new input is introduced `relax_type` that replaces the old `relaxation_scheme` that is deprecated. The `relax_type` can take values as specified by the `RelaxType` enum.
66c565d
to
28f396c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, thanks @sphuber!
Fixes #611
The
relaxation_scheme
was used to communicate the type of relaxationto be performed and accepted either
relax
orvc-relax
, directlymodeled after the relax options that could be passed to the
CONTROL.calculation
input parameter.There are, however, many other relax modes possible, such as those
constraining parts of the degree of freedom of the cell. To support
these a new input is introduced
relax_type
that replaces the oldrelaxation_scheme
that is deprecated. Therelax_type
can take valuesas specified by the
RelaxType
enum.