finesse.script.legacy.KatParser.parse_file

KatParser.parse_file(path, model=None, **kwargs)[source]

Parse kat code from a file into a model.

Parameters
pathstr or io.FileIO

The path or file object to read kat script from. If an open file object is passed, it will be read from and left open. If a path is passed, it will be opened, read from, then closed.

modelModel, optional

Model object to add components to. If not specified, a new model will be created.

Other Parameters
**kwargs

Keyword parameters supported by parse().

Raises
KatParserError

If an error occurs during parsing or building.