finesse.model.Model.connect¶
- Model.connect(A, B, L=0, nr=1, *, delay=None, name=None, verbose=False, connector=None)[source]¶
Connects two ports in a model together. The ports should be of the same type, e.g. both optical ports.
This method will also accept components from the user, in such cases it will loop through the ports and use the first one in .ports that is currently unconnected.
As connect will try to be somewhat smart in guessing what the user is trying to connect, use verbose=True to print what is actually getting connected.
- Parameters:
- A
Connector
orPort
Component to connect
- B
Connector
orPort
Other component to connect
- Lfloat, optional
Length of newly created
Space
orWire
instance. If connecting electronics, L will be treated as a delay in seconds- nrfloat, optional
Index of refraction of newly created
Space
.- delayfloat, optional
Delay time for electrical connections.
- namestr, optional
- verbosebool, optional
When True, the actual connections being made will be printed.
- A
- Raises:
- Exception
If matrix has already been built, either of compA or compB are not present in the model, either of portA or portB are already connected or either of portA or portB are not valid options at the specified component(s).