aiida_pseudo.data.pseudo.upf#

Module for data plugin to represent a pseudo potential in UPF format.

Module Contents#

Classes#

UpfData

Data plugin to represent a pseudo potential in UPF format.

class aiida_pseudo.data.pseudo.upf.UpfData#

Bases: aiida_pseudo.data.pseudo.pseudo.PseudoPotentialData

Data plugin to represent a pseudo potential in UPF format.

property z_valence: int | None#

Return the Z valence.

Returns:

the Z valence.

_key_z_valence = 'z_valence'#
set_file(source: str | pathlib.Path | BinaryIO, filename: str | None = None, **kwargs)#

Set the file content and parse other optional attributes from the content.

Note

this method will first analyse the type of the source and if it is a filepath will convert it to a binary stream of the content located at that filepath, which is then passed on to the superclass. This needs to be done first, because it will properly set the file and filename attributes that are expected by other methods. Straight after the superclass call, the source seeker needs to be reset to zero if it needs to be read again, because the superclass most likely will have read the stream to the end. Finally it is important that the prepare_source is called here before the superclass invocation, because this way the conversion from filepath to byte stream will be performed only once. Otherwise, each subclass would perform the conversion over and over again.

Parameters:
  • source – the source pseudopotential content, either a binary stream, or a str or Path to the path of the file on disk, which can be relative or absolute.

  • filename – optional explicit filename to give to the file stored in the repository.

Raises:
  • TypeError – if the source is not a str, pathlib.Path instance or binary stream.

  • FileNotFoundError – if the source is a filepath but does not exist.

  • ValueError – if the element symbol is invalid.