The parser of xml file model_cof.xml located at the root of the model package. This file is optional in package

model_conf_parser API reference


class macsypy.model_conf_parser.ModelConfParser(path)[source]

Handle model_conf.xml configuration file.

Parameters:path (str) – The path to the configuration file

list of weak references to the object (if defined)


Find the root of the document

Returns:the document root of model_conf
_parse_section(section_node, allowed_elements)[source]

Parse a node containing configurations options and value

  • section_node
  • allowed_elements (a dict with options name as keys and function to parse the element) – The elements allowed in this section Only these elements are parsed and in the final dictionnary



Parse the xml ‘model_conf’ file set at the root of a data package

Returns:The specific configuration for a model family
Return type:dict with the name of variables as keys and value as values

Parse the node ‘filtering’ containing the filtering options configuration

Parameters:filtering_node (:class”Et.ElementTree object) – the node ‘filtering’
Returns:the configuration option/value about the filtering
Return type:dict

Parse the node ‘weights’ contening the scoring weight configuration

Parameters:weights_node (:class”Et.ElementTree object) – the node ‘weights’
Returns:the configuration option/value about the scores
Return type:dict