Converters

Module with converters from other formats.

exception pyked.converters.KeywordError(*keywords)[source]

Raised for errors in keyword parsing.

exception pyked.converters.MissingAttributeError(*keywords)[source]

Raised for missing required attribute.

exception pyked.converters.MissingElementError(*keywords)[source]

Raised for missing required elements.

exception pyked.converters.ParseError[source]

Base class for errors.

pyked.converters.ReSpecTh_to_ChemKED(filename_xml, file_author='', file_author_orcid='', *, validate=False)[source]

Convert ReSpecTh XML file to ChemKED-compliant dictionary.

Parameters:
  • filename_xml (str) – Name of ReSpecTh XML file to be converted.

  • file_author (str, optional) – Name to override original file author

  • file_author_orcid (str, optional) – ORCID of file author

  • validate (bool, optional, keyword-only) – Set to True to validate the resulting property dictionary with ChemKED. Set to False if the file is being loaded and will be validated at some other point before use.

pyked.converters.ck2respth(argv=None)[source]

Command-line entry point for converting a ChemKED YAML file to a ReSpecTh XML file.

pyked.converters.datagroup_properties = ['temperature', 'pressure', 'ignition delay', 'pressure rise']

Valid properties for a ReSpecTh dataGroup

Type:

list

pyked.converters.get_common_properties(root)[source]

Read common properties from root of ReSpecTh XML file.

Parameters:

root (Element) – Root of ReSpecTh XML file

Returns:

Dictionary with common properties

Return type:

properties (dict)

pyked.converters.get_datapoints(root)[source]

Parse datapoints with ignition delay from file.

Parameters:

root (Element) – Root of ReSpecTh XML file

Returns:

Dictionary with ignition delay data

Return type:

properties (dict)

pyked.converters.get_experiment_kind(root)[source]

Read common properties from root of ReSpecTh XML file.

Parameters:

root (Element) – Root of ReSpecTh XML file

Returns:

Dictionary with experiment type and apparatus information.

Return type:

properties (dict)

pyked.converters.get_file_metadata(root)[source]

Read and parse ReSpecTh XML file metadata (file author, version, etc.)

Parameters:

root (Element) – Root of ReSpecTh XML file

Returns:

Dictionary with file metadata

Return type:

properties (dict)

pyked.converters.get_ignition_type(root)[source]

Gets ignition type and target.

Parameters:

root (Element) – Root of ReSpecTh XML file

Returns:

Dictionary with ignition type/target information

Return type:

properties (dict)

pyked.converters.get_reference(root)[source]

Read reference info from root of ReSpecTh XML file.

Parameters:

root (Element) – Root of ReSpecTh XML file

Returns:

Dictionary with reference information

Return type:

properties (dict)

pyked.converters.main(argv=None)[source]

General function for converting between ReSpecTh and ChemKED files based on extension.

pyked.converters.respth2ck(argv=None)[source]

Command-line entry point for converting a ReSpecTh XML file to a ChemKED YAML file.