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: block family cutoffs set for established families #134

Merged
merged 3 commits into from
Oct 10, 2022

Conversation

mbercx
Copy link
Member

@mbercx mbercx commented Oct 9, 2022

One of the motivations of having dedicated and automated CLI commands to install established pseudpotential families like the SSSP or the Pseudo-dojo normconserving pseudopotentials is to try and prevent that the pseudopotentials or recommended cutoffs deviate from the official ones. However, the family cutoffs set command currently allows the user to change the recommended cutoffs easily through the CLI.

In order to prevent this, we block usage of the command for SsspFamily and PseudoDojoFamily's, by adding an exclude input argument to the PseudoPotentialFamilyParam, where the entry points of the classes that should be disallowed can be provided. This is then used to adapt the option decorator for the PSEUDO_POTENTIAL_FAMILY input argument of family cutoffs set.

Note that the user can still install e.g. the SSSP with their own recommended cutoffs using the install family command as a CutoffsPseudoPotentialFamily. However, the SsspFamily class is reserved for pseudopotentials installed with the automated install command.

@mbercx mbercx requested a review from sphuber October 9, 2022 15:50
@mbercx mbercx force-pushed the fix/block-cutoffs-set branch from 8525390 to cf2567b Compare October 9, 2022 16:06
Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

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

Thanks @mbercx . Very nice and clear. Just some minor comments

docs/source/design.rst Outdated Show resolved Hide resolved
docs/source/design.rst Outdated Show resolved Hide resolved
src/aiida_pseudo/cli/params/types.py Outdated Show resolved Hide resolved
src/aiida_pseudo/cli/params/types.py Outdated Show resolved Hide resolved
tests/cli/test_family.py Show resolved Hide resolved
One of the motivations of having dedicated and automated CLI commands to
install established pseudpotential families like the SSSP or the
Pseudo-dojo normconserving pseudopotentials is to try and prevent that
the pseudopotentials or recommended cutoffs deviate from the official
ones. However, the `family cutoffs set` command currently allows the
user to change the recommended cutoffs easily through the CLI.

In order to prevent this, we block usage of the command for `SsspFamily`
and `PseudoDojoFamily`'s, by adding an `exclude` input argument to the
`PseudoPotentialFamilyParam`, where the entry points of the classes that
should be disallowed can be provided. This is then used to adapt the
option decorator for the `PSEUDO_POTENTIAL_FAMILY` input argument of
`family cutoffs set`.

Note that the user _can_ still install e.g. the SSSP with their own
recommended cutoffs using the `install family` command as a
`CutoffsPseudoPotentialFamily`. However, the `SsspFamily` class is
reserved for pseudopotentials installed with the automated install
command.
@mbercx mbercx force-pushed the fix/block-cutoffs-set branch from 6562cf3 to 54028cc Compare October 10, 2022 10:08
@mbercx mbercx requested a review from sphuber October 10, 2022 10:45
@sphuber
Copy link
Contributor

sphuber commented Oct 10, 2022

Beautiful, all good, thanks @mbercx

@mbercx mbercx merged commit bedbf44 into aiidateam:master Oct 10, 2022
@mbercx mbercx deleted the fix/block-cutoffs-set branch October 10, 2022 12:13
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.

2 participants