aiida_pseudo.data.pseudo.upf#
Module for data plugin to represent a pseudo potential in UPF format.
Classes#
Data plugin to represent a pseudo potential in UPF format. |
Module Contents#
- class aiida_pseudo.data.pseudo.upf.UpfData#
Bases:
aiida_pseudo.data.pseudo.pseudo.PseudoPotentialDataData plugin to represent a pseudo potential in UPF format.
- _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
sourceand 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 theprepare_sourceis 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
strorPathto 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.Pathinstance or binary stream.FileNotFoundError – if the source is a filepath but does not exist.
ValueError – if the element symbol is invalid.
- property z_valence: int | None#
Return the Z valence.
- Returns:
the Z valence.