aiida_vasp.parsers.content_parsers.poscar#

The POSCAR/CONTCAR parser interface.

Module Contents#

Classes#

PoscarParser

The parser interface that enables parsing of POSCAR/CONTCAR content.

Functions#

parsevasp_to_aiida

parsevasp to AiiDA conversion.

fetch_symbols_from_elements

Fetch the symbol entry in the elements dictionary in Aiida.

API#

class aiida_vasp.parsers.content_parsers.poscar.PoscarParser(*, precision=12, **kwargs)[source]#

Bases: aiida_vasp.parsers.content_parsers.base.BaseFileParser

The parser interface that enables parsing of POSCAR/CONTCAR content.

The parser is triggered by using the poscar-structure quantity key. The quantity key structure will on the other hand parse the structure using the XML parser.

precisionint, optional

An integer specifying the number of digits for floating point numbers that will be written to POSCAR/CONTCAR. Defaults to 12.

Initialization

Initialize an instance of this class.

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

Initialize a parsevasp object of Poscar using a file like handler.

handlerobject

A file like object that provides the necessary POSCAR`/``CONTCAR` content to be parsed.

_init_from_data(data)[source]#

Initialize using an AiiDA StructureData instance.

dataobject

A valid AiiDA StructureData object.

property structure#

Return a structure that is ready to be consumed by the the AiiDA StructureData.

aiida_structuredict

A dict that contain keys comment, unitcell and sites, which are compatible with consumption of the initialization of the AiiDA StructureData.

_content_data_to_content_parser()[source]#

Convert an AiiDA StructureData to a content parser instance of Poscar from parsevasp.

content_parserobject

An instance of Poscar from parsevasp.

transform_to_bool(value)[source]#

Helper function to transform the dictionary from strings or integers to bools

aiida_vasp.parsers.content_parsers.poscar.parsevasp_to_aiida(poscar)[source]#

parsevasp to AiiDA conversion.

Generate an AiiDA structure that can be consumed by StructureData on initialization from the parsevasp instance of the Poscar class.

poscarobject

An instance of the Poscar class in parsevasp.

poscar_dictdict

A dictionary representation which are ready to be used when creating an AiiDA StructureData instance.

aiida_vasp.parsers.content_parsers.poscar.fetch_symbols_from_elements(elmnts)[source]#

Fetch the symbol entry in the elements dictionary in Aiida.