aiida_vasp.parsers.content_parsers.potcar#

POTCAR parser.

Module Contents#

Classes#

PotcarParser

A lightweight interface that provides access to POTCAR metadata parsing.

PotcarIo

Deals with VASP input output of POTCAR files.

MultiPotcarIo

Handle file i/o for POTCAR files with one or more potentials.

API#

class aiida_vasp.parsers.content_parsers.potcar.PotcarParser(*, handler=None, data=None, settings=None, options=None)[source]#

Bases: aiida_vasp.parsers.content_parsers.base.BaseFileParser

A lightweight interface that provides access to POTCAR metadata parsing.

Similar to the other content parser for VASP in structure, but only used directly in the POTCAR handling logic.

Initialization

DEFAULT_SETTINGS = None#
PARSABLE_QUANTITIES = None#
_init_from_handler(handler)[source]#

Initialize using a file like handler.

handlerobject

A file like object that provides the necessary content to be parsed.

property metadata#

Return the metadata Potcar instance.

abstract _init_from_data(data)[source]#

No need to init from an AiiDA data structure.

abstract _content_data_to_content_parser()[source]#

Since no need to accept AiiDA data structure, no need to convert it.

class aiida_vasp.parsers.content_parsers.potcar.PotcarIo(**kwargs)[source]#

Deals with VASP input output of POTCAR files.

Instanciate with one of the following kwargs:

Parameters:
  • path – (string) absolute path to the POTCAR file

  • potcar_node – a PotcarData node

  • potcar_file_node – a PotcarFileNode

  • contents – a string with the POTCAR content

Initialization

Init from Potcar object or delegate to kwargs initializers.

init_with_kwargs(**kwargs)[source]#

Delegate initialization to _init_with - methods.

_init_with_path(file_path)[source]#

Initialize with a path.

_init_with_potcar_file_node(node)[source]#

Initialize with an existing potential file node.

_init_with_potcar_node(node)[source]#

Initialize with an existing potential node.

_init_with_contents(contents)[source]#

Initialize with a string.

property file_node#
property node#
property content#
classmethod from_(potcar)[source]#

Determine the best guess at how the input represents a POTCAR file and construct a PotcarIo instance based on that.

__eq__(other)[source]#
class aiida_vasp.parsers.content_parsers.potcar.MultiPotcarIo(potcars=None)[source]#

Handle file i/o for POTCAR files with one or more potentials.

Initialization

append(potcar)[source]#
write(path)[source]#
classmethod read(path)[source]#

Read a POTCAR file that may contain one or more potentials into a list of PotcarIo objects.

property potcars#
classmethod from_structure(structure, potentials_dict)[source]#

Create a MultiPotcarIo from an AiiDA StructureData object and a dictionary with a potential for each kind in the structure.

get_potentials_dict(structure)[source]#

Get a dictionary {kind_name: PotcarData} that would fit the structure.

If the PotcarData contained in MultiPotcarIo do not match the structure, an exception is raised.

property element_symbols#
classmethod potentials_order(structure)[source]#
classmethod count_kinds(structure)[source]#

Count consecutive kinds that compose the different sites.

Returns:

[(kind_name, num), … ]