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

CLI: do not override existing stringencies in family cutoffs set #71

Merged
merged 1 commit into from
Apr 12, 2021

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Apr 12, 2021

Fixes #66

The command's interface only allows to specify a single stringency at a
time, however, it would use the set_cutoffs method internally, which
would override any existing stringencies. This bug is addressed by first
retrieving existing stringencies before adding the new one to it and
setting the ensemble as the new stringencies.

There is an additional limitation that needs to be taken into account,
however. Since the current design only allows for a single energy unit
to be used at a time for all stringencies, when adding a new stringency,
the same unit has to be used. If, in the future, set_cutoffs starts to
support setting individual stringencies additively and the family
supports multiple units for the different stringencies, then all of this
logic can be simplified significantly and the limitations removed.

The command's interface only allows to specify a single stringency at a
time, however, it would use the `set_cutoffs` method internally, which
would override any existing stringencies. This bug is addressed by first
retrieving existing stringencies before adding the new one to it and
setting the ensemble as the new stringencies.

There is an additional limitation that needs to be taken into account,
however. Since the current design only allows for a single energy unit
to be used at a time for all stringencies, when adding a new stringency,
the same unit has to be used. If, in the future, `set_cutoffs` starts to
support setting individual stringencies additively and the family
supports multiple units for the different stringencies, then all of this
logic can be simplified significantly and the limitations removed.
@sphuber sphuber requested a review from mbercx April 12, 2021 07:34
@sphuber
Copy link
Contributor Author

sphuber commented Apr 12, 2021

@mbercx thought to fix this bug before you start implementing the new interface. I left comments in the code where workarounds are currently added, which can be simplified when that happens.

Copy link
Member

@mbercx mbercx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the eight day he reviewed @sphuber's code, and he saw that it was good.

@sphuber sphuber merged commit a9f6f2a into master Apr 12, 2021
@sphuber sphuber deleted the fix/066/cli-set-cutoffs-override branch April 12, 2021 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI: aiida-pseudo family cutoffs set removes all other stringencies
2 participants