class modeci_mdf.mdf.Model(id: str, graphs: List[Graph] = _Nothing.NOTHING, format: str = 'ModECI MDF v0.4', generating_application: str = 'Python modeci-mdf v0.4.8', onnx_opset_version: Optional[str] = None, *, metadata: Optional[Dict[str, Any]] = None)[source]

Bases: MdfBase

The top level construct in MDF is Model, which may contain multiple Graph objects and model attribute(s)

  • id (str) – A unique identifier for this Model

  • graphs (List[modeci_mdf.mdf.Graph]) – The collection of graphs that make up the MDF model.

  • format (str) – Information on the version of MDF used in this file

  • generating_application (str) – Information on what application generated/saved this file

  • onnx_opset_version (Optional[str]) – The ONNX opset used for any ONNX functions in this model.

Method generated by attrs for class Model.


to_graph_image([engine, output_format, ...])

Convert MDF graph to an image (png or svg) using the Graphviz export

to_graph_image(engine: str = 'dot', output_format: str = 'png', view_on_render: bool = False, level: int = 2, filename_root: Optional[str] = None, only_warn_on_fail: bool = False, is_horizontal: bool = False, solid_color=False)[source]

Convert MDF graph to an image (png or svg) using the Graphviz export

  • engine – dot or other Graphviz formats

  • output_format – e.g. png (default) or svg

  • view_on_render – if True, will open generated image in system viewer

  • level – 1,2,3, depending on how much detail to include

  • filename_root – will change name of file generated to filename_root.png, etc.

  • only_warn_on_fail – just give a warning if this fails, e.g. no dot executable. Useful for preventing errors in automated tests

  • solid_color – if True, will return a solid color for the graphviz node. default is False