Skip to content

Commit

Permalink
Add support for Pseudo-dojo v0.5
Browse files Browse the repository at this point in the history
Add the various configurations/urls for Pseudo-dojo v0.5, and
add the option to the CLI install command.

Since the `.djrepo` files are missing the `hints` generated
using the delta factor, fall back on the `ppgen_hints` provided
by ONCVPSP in this case.

Cherry-pick: 2796a7f
  • Loading branch information
mbercx authored and sphuber committed Aug 30, 2023
1 parent d526330 commit 71651b5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion aiida_pseudo/cli/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def cmd_install_sssp(version, functional, protocol, download_only, traceback):


@cmd_install.command('pseudo-dojo')
@options.VERSION(type=click.Choice(['0.4', '1.0']), default='0.4', show_default=True)
@options.VERSION(type=click.Choice(['0.4', '0.5', '1.0']), default='0.4', show_default=True)
@options.FUNCTIONAL(type=click.Choice(['PBE', 'PBEsol', 'LDA']), default='PBE', show_default=True)
@options.RELATIVISTIC(type=click.Choice(['SR', 'SR3plus', 'FR']), default='SR', show_default=True)
@options.PROTOCOL(type=click.Choice(['standard', 'stringent']), default='standard', show_default=True)
Expand Down
18 changes: 15 additions & 3 deletions aiida_pseudo/groups/family/pseudo_dojo.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ class PseudoDojoFamily(RecommendedCutoffMixin, PseudoPotentialFamily):
PseudoDojoConfiguration('0.4', 'PBE', 'FR', 'stringent', 'psml'),
PseudoDojoConfiguration('0.4', 'PBEsol', 'FR', 'standard', 'psml'),
PseudoDojoConfiguration('0.4', 'PBEsol', 'FR', 'stringent', 'psml'),
PseudoDojoConfiguration('0.5', 'PBE', 'SR', 'standard', 'psp8'),
PseudoDojoConfiguration('0.5', 'PBE', 'SR', 'stringent', 'psp8'),
PseudoDojoConfiguration('0.5', 'PBE', 'SR', 'standard', 'upf'),
PseudoDojoConfiguration('0.5', 'PBE', 'SR', 'stringent', 'upf'),
PseudoDojoConfiguration('0.5', 'PBE', 'SR', 'standard', 'psml'),
PseudoDojoConfiguration('0.5', 'PBE', 'SR', 'stringent', 'psml'),
PseudoDojoConfiguration('1.0', 'PBE', 'SR', 'standard', 'jthxml'),
PseudoDojoConfiguration('1.0', 'PBE', 'SR', 'stringent', 'jthxml'),
PseudoDojoConfiguration('1.0', 'LDA', 'SR', 'standard', 'jthxml'),
Expand Down Expand Up @@ -111,6 +117,12 @@ class PseudoDojoFamily(RecommendedCutoffMixin, PseudoPotentialFamily):
'PseudoDojo/0.4/PBE/FR/stringent/psml': 'nc-fr-04_pbe_stringent_psml',
'PseudoDojo/0.4/PBEsol/FR/standard/psml': 'nc-fr-04_pbesol_standard_psml',
'PseudoDojo/0.4/PBEsol/FR/stringent/psml': 'nc-fr-04_pbesol_stringent_psml',
'PseudoDojo/0.5/PBE/SR/standard/psp8': 'nc-sr-05_pbe_standard_psp8',
'PseudoDojo/0.5/PBE/SR/stringent/psp8': 'nc-sr-05_pbe_stringent_psp8',
'PseudoDojo/0.5/PBE/SR/standard/upf': 'nc-sr-05_pbe_standard_upf',
'PseudoDojo/0.5/PBE/SR/stringent/upf': 'nc-sr-05_pbe_stringent_upf',
'PseudoDojo/0.5/PBE/SR/standard/psml': 'nc-sr-05_pbe_standard_psml',
'PseudoDojo/0.5/PBE/SR/stringent/psml': 'nc-sr-05_pbe_stringent_psml',
'PseudoDojo/1.0/PBE/SR/standard/jthxml': 'paw_pbe_standard_xml',
'PseudoDojo/1.0/PBE/SR/stringent/jthxml': 'paw_pbe_stringent_xml',
'PseudoDojo/1.0/LDA/SR/standard/jthxml': 'paw_pw_standard_xml',
Expand Down Expand Up @@ -190,7 +202,7 @@ def get_md5_from_djrepo(cls, djrepo, pseudo_type):
try:
md5 = djrepo[md5_key]
except KeyError as exception:
raise ParsingError(f'key `{cls.md5_key}` is not defined in the djrepo: {exception}') from exception
raise ParsingError(f'key `{md5_key}` is not defined in the djrepo: {exception}') from exception

return md5

Expand Down Expand Up @@ -222,9 +234,9 @@ def get_cutoffs_from_djrepo(cls, djrepo, pseudo_type):
cutoffs = {}

try:
hints = djrepo['hints']
hints = djrepo.get('hints', None) or djrepo['ppgen_hints']
except KeyError as exception:
raise ParsingError('key `hints` is not defined in the djrepo.') from exception
raise ParsingError('neither `hints` or `ppgen_hints` are defined in the djrepo.') from exception

for stringency in ['low', 'normal', 'high']:

Expand Down

0 comments on commit 71651b5

Please sign in to comment.