aiida_quantumespresso.parsers.parse_xml.versions#

Module Contents#

Classes#

QeXmlVersion

An enum with the versions of XML output file known to exist for Quantum ESPRESSO.

Functions#

get_xml_file_version(xml)

Return the version of the Quantum ESPRESSO pw.x and cp.x XML output file.

get_schema_filepath(xml)

Return the absolute filepath to the XML schema file that can be used to parse the given XML.

get_default_schema_filepath()

Return the absolute filepath to the default XML schema file.

get_schema_filename(xml)

Return the filename of the schema file that corresponds to the given XML object.

get_available_xml_schemas()

Return the filenames of the available XML schemas.

is_valid_post_6_2_version(xml)

Return whether the given XML object corresponds to an XML output file of Quantum ESPRESSO pw.x post v6.2.

is_valid_pre_6_2_version(xml)

Returns whether the given XML object corresponds to an XML output file of Quantum ESPRESSO pw.x pre v6.2.

Attributes#

DEFAULT_SCHEMA_FILENAME

DIRNAME_SCHEMAS

DIRPATH_SCHEMAS

aiida_quantumespresso.parsers.parse_xml.versions.DEFAULT_SCHEMA_FILENAME = 'qes-1.0.xsd'[source]#
aiida_quantumespresso.parsers.parse_xml.versions.DIRNAME_SCHEMAS = 'schemas'[source]#
aiida_quantumespresso.parsers.parse_xml.versions.DIRPATH_SCHEMAS[source]#
class aiida_quantumespresso.parsers.parse_xml.versions.QeXmlVersion(*args, **kwds)[source]#

Bases: enum.Enum

An enum with the versions of XML output file known to exist for Quantum ESPRESSO.

PRE_6_2 = 0[source]#
POST_6_2 = 1[source]#
aiida_quantumespresso.parsers.parse_xml.versions.get_xml_file_version(xml)[source]#

Return the version of the Quantum ESPRESSO pw.x and cp.x XML output file.

Parameters:

xml – the pre-parsed XML object

Raises:

XMLUnsupportedFormatError – if the file cannot be read, parsed or if the version cannot be determined

aiida_quantumespresso.parsers.parse_xml.versions.get_schema_filepath(xml)[source]#

Return the absolute filepath to the XML schema file that can be used to parse the given XML.

Parameters:

xml – the pre-parsed XML object

Returns:

the XSD absolute filepath

aiida_quantumespresso.parsers.parse_xml.versions.get_default_schema_filepath()[source]#

Return the absolute filepath to the default XML schema file.

Parameters:

xml – the pre-parsed XML object

Returns:

the XSD absolute filepath

aiida_quantumespresso.parsers.parse_xml.versions.get_schema_filename(xml)[source]#

Return the filename of the schema file that corresponds to the given XML object.

Parameters:

xml – the pre-parsed XML object

Returns:

the XSD filename

aiida_quantumespresso.parsers.parse_xml.versions.get_available_xml_schemas()[source]#

Return the filenames of the available XML schemas.

These are essentially all the files with the .xsd extenstion in the DIRPATH_SCHEMAS folder

Returns:

a list of XML schema filenames

aiida_quantumespresso.parsers.parse_xml.versions.is_valid_post_6_2_version(xml)[source]#

Return whether the given XML object corresponds to an XML output file of Quantum ESPRESSO pw.x post v6.2.

These versions of the output XML are parsable with an XSD schema file

Parameters:

xml – a parsed XML output file

Returns:

boolean, True when the XML is parsable with an XSD schema file, False otherwise

aiida_quantumespresso.parsers.parse_xml.versions.is_valid_pre_6_2_version(xml)[source]#

Returns whether the given XML object corresponds to an XML output file of Quantum ESPRESSO pw.x pre v6.2.

Parameters:

xml – a parsed XML output file

Returns:

boolean, True when the XML was produced by Quantum ESPRESSO with the old XML format