finesse.model.Model.built

Model.built(simulation_type=None, simulation_options=None)[source]

Context manager for making a simulation to work with. Once the context manager has been closed the simulation object and all its memory will be freed up.

Parameters
simulation_optionsdict

Options for type of simulation to run and its settings

Yields
BaseSimulation

Simulation object to interact with after it has been built.

Examples

>>> import finesse
>>> model = finesse.script.parse('''
... ... some KatScript ...
... ''')
>>>
>>> with model.built() as sim:
...     # interact with simulation object
...     ...