aiida_pseudo.groups.family.pseudo_dojo#

Subclass of PseudoPotentialFamily designed to represent a PseudoDojo configuration.

Classes#

PseudoDojoConfiguration

Named tuple that represents a PseudoDojo configuration.

PseudoDojoFamily

Subclass of PseudoPotentialFamily designed to represent a PseudoDojo configuration.

Module Contents#

class aiida_pseudo.groups.family.pseudo_dojo.PseudoDojoConfiguration#

Bases: NamedTuple

Named tuple that represents a PseudoDojo configuration.

version: str#
functional: str#
relativistic: str#
protocol: str#
pseudo_format: str#
__str__()#

Represent the configuration as a string.

class aiida_pseudo.groups.family.pseudo_dojo.PseudoDojoFamily(label=None, **kwargs)#

Bases: aiida_pseudo.groups.mixins.RecommendedCutoffMixin, aiida_pseudo.groups.family.pseudo.PseudoPotentialFamily

Subclass of PseudoPotentialFamily designed to represent a PseudoDojo configuration.

The PseudoDojoFamily is essentially a PseudoPotentialFamily with some additional constraints. It can only be used to contain the pseudo potentials and corresponding metadata of an official PseudoDojo configuration.

_pseudo_types#
_pseudo_repo_file_extensions = ('djrepo',)#
label_template = 'PseudoDojo/{version}/{functional}/{relativistic}/{protocol}/{pseudo_format}'#
default_configuration#
valid_configurations#
url_base = 'http://www.pseudo-dojo.org/pseudos/'#
urls: ClassVar[dict[str, str]]#
classmethod get_valid_labels() Sequence[str]#

Return the tuple of labels of all valid PseudoDojo configurations.

classmethod format_configuration_label(configuration: PseudoDojoConfiguration) str#

Format a label for an PseudoDojoFamily with the required syntax.

Parameters:

configuration – the PseudoDojo configuration.

Returns:

label.

classmethod get_url_archive(label)#

Return the URL for the pseudopotential archive file for a given family label.

Parameters:

label – the family label as formatted by format_configuration_label.

Returns:

the URL from which the pseudopotential archive can be downloaded.

Raises:

ValueError if the label is not a valid configuration label.

classmethod get_url_metadata(label)#

Return the URL for the pseudopotential metadata file for a given family label.

Parameters:

label – the family label as formatted by format_configuration_label.

Returns:

the URL from which the pseudopotential metadata can be downloaded.

Raises:

ValueError if the label is not a valid configuration label.

classmethod get_md5_from_djrepo(djrepo, pseudo_type)#

Get the appropriate md5 hash from a DJREPO file.

Parameters:

djrepo – dictionary loaded from DJREPO JSON file.

Reutnrs:

md5 string.

classmethod get_cutoffs_from_djrepo(djrepo, pseudo_type)#

Collect and organize the suggested cutoffs (hints) from a DJREPO file.

DJREPO files only provide a kinetic energy cutoff, so for pseudo types which contain norm-conserving pseudos from PseudoDojo, we use a dual of 8.0 to generate the charge density (rho) cutoff.

For PAW potentials from PseudoDojo (which are assumed to be JthXmlData), a dual of 2.0 is used.

The cutoffs in DJREPO files are given in Hartree, which is converted to eV.

Parameters:

djrepo – dictionary loaded from DJREPO JSON file

Returns:

cutoffs dictionary (in eV) where keys are stringency levels and values are {‘cutoff_wfc’: …, ‘cutoff_rho’: …}

classmethod parse_djrepos_from_folder(dirpath: pathlib.Path, pseudo_type)#

Parse the djrepo files in the given directory into a list of data nodes.

Note

The directory pointed to by dirpath should only contain djrepo files. Optionally, it can contain just a single directory, that contains all the djrepo files. If any other files are stored in the basepath or the subdirectory that cannot be successfully parsed as djrepo files the method will raise a ValueError.

Parameters:

dirpath – absolute path to a directory containing djrepos.

Returns:

list of data nodes.

Raises:
  • ValueError – if dirpath is not a directory or contains anything other than files.

  • ValueError – if dirpath contains multiple djrepos for the same element.

  • ParsingError – if the constructor of the pseudo type fails for one of the files in the dirpath.

classmethod parse_djrepos_from_archive(filepath_metadata: pathlib.Path, fmt=None, pseudo_type=None)#

Parse metadata from a djrepo .tgz archive.

Warning

the archive should not contain any subdirectories, but just the djrepo files.

Parameters:
  • filepath_metadata – the path to the metadata .tgz archive.

  • fmt – the format of the archive, if not specified will attempt to guess based on extension of filepath.

  • pseudo_type – subclass of PseudoPotentialData to be used for the parsed pseudos. If not specified and the family only defines a single supported pseudo type in _pseudo_types then that will be used otherwise a ValueError is raised.

Returns:

element: value dictionaries containing md5s and cutoffs.

Raises:

OSError – if the archive could not be unpacked or the djrepos in it could not be parsed into md5s and cutoffs.