aiida_vasp.parsers.content_parsers.kpoints#

The KPOINTS parser interface.

Contains the parsing interfaces to parsevasp used to parse KPOINTS content.

Module Contents#

Classes#

KpointsParser

The parser interface that enables parsing of KPOINTS content.

Functions#

parsevasp_to_aiida

parsevasp to AiiDA conversion.

API#

class aiida_vasp.parsers.content_parsers.kpoints.KpointsParser(*, handler: TextIO | BinaryIO | None = None, data: aiida.orm.Data | None = None, settings: dict[str, Any] | None = None, options: dict[str, Any] | None = None, raise_errors: bool = False)[source]#

Bases: aiida_vasp.parsers.content_parsers.base.BaseFileParser

The parser interface that enables parsing of KPOINTS content.

The parser is triggered by using the kpoints-kpoints quantity key. The quantity key kpoints will on the other hand parse the k-points using the XML parser.

Initialization

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

Initialize using a file like handler.

Parameters:

handler (file-like object) – A file like object that provides the necessary content to be parsed.

_init_from_data(data: aiida.orm.KpointsData) None[source]#

Initialize using AiiDA KpointsData.

property kpoints: dict[str, Any] | None#

Return kpoints that is ready to be consumed by the the AiiDA KpointsData.

AiiDA does not support the line mode used in VASP, so we give a warning that parsing this is not supported.

Returns:

A dict that contain keys comment, divisions, shifts, points, tetra, tetra_volume, mode centering, num_kpoints, weights and cartesian which are compatible with consumption of the initialization of the AiiDA KpointsData.

Return type:

dict

_content_data_to_content_parser() Any[source]#

Convert an AiiDA KpointsData to a content parser instance of Kpoints from parsevasp.

Returns:

An instance of Kpoints from parsevasp.

Return type:

object

_get_kpointsdict_explicit(kpoints_data: aiida.orm.KpointsData) dict[str, Any][source]#

Turn Aiida KpointData into a k-points dictionary with explicit generation of points.

Parameters:

kpoints_data (object) – An AiiDA KpointsData object containing explicit k-point sets.

Returns:

A dictionary that can be used to initialize a parsevasp Kpoints instance.

Return type:

dict

static _get_kpointsdict_automatic(kpointsdata: aiida.orm.KpointsData) dict[str, Any][source]#

Turn Aiida KpointData into a k-point dictionary with automatic generation of points.

Parameters:

kpointsdata (object) – An AiiDA KpointsData object containing meshed k-point sets.

Returns:

A dictionary that can be used to initialize a parsevasp Kpoints instance.

Return type:

dict

aiida_vasp.parsers.content_parsers.kpoints.parsevasp_to_aiida(kpoints: parsevasp.kpoints.Kpoints, logger: Any) dict[str, Any] | None[source]#

parsevasp to AiiDA conversion.

Generate an AiiDA data structure that can be consumed by KpointsData on initialization from the parsevasp instance of the Kpoints class.

Parameters:
  • kpoints (object) – An instance of the Kpoints class in parsevasp.

  • logger (object) – Logger instance for warnings and debug messages.

Returns:

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

Return type:

dict