finesse.exceptions module

Custom exception types raised by different Finesse functions and class methods.

exception finesse.exceptions.BeamTraceException(message, **kwargs)[source]

Bases: FinesseException

exception finesse.exceptions.BrokenDOFLinkError(message, broken_parameters: list[Parameter], **kwargs)[source]

Bases: FinesseException

Thrown when the links between a Degree of Freedom and the parameters it is supposed to drive are broken

exception finesse.exceptions.ComponentNotConnected(message, **kwargs)[source]

Bases: FinesseException

exception finesse.exceptions.ContextualArgumentError(message, **kwargs)[source]

Bases: FinesseException

An argument error with additional context.

This allows Finesse objects to provide additional information to the user when invalid values are passed to functions and methods.

empty[source]

alias of _empty

exception finesse.exceptions.ContextualTypeError(param, value, allowed_types=None, name=None)[source]

Bases: ContextualArgumentError

A type error with additional information about the available types.

message()[source]
exception finesse.exceptions.ContextualValueError(params: dict, extra_info: str | None = None)[source]

Bases: ContextualArgumentError

A value error with additional information about value(s) that caused an error.

message()[source]
exception finesse.exceptions.ControlledByDOFException(message, **kwargs)[source]

Bases: FinesseException

Raised when a parameter value is changed but there are other elements that are controlling what the value is.

exception finesse.exceptions.ConvergenceException(message, **kwargs)[source]

Bases: FinesseException

Indicates an algorithm has failed to converge to some requested tolerance.

exception finesse.exceptions.DoubleConnectionError(message, **kwargs)[source]

Bases: FinesseException

Thrown when a connections is made to a port that is already connected

exception finesse.exceptions.EvaluateResolvingSymbolError(message, **kwargs)[source]

Bases: FinesseException

Thrown when trying to evaluate a parameter that is currently resolving.

exception finesse.exceptions.FinesseException(message, **kwargs)[source]

Bases: Exception

The exception type which gets raised upon a Finesse failure.

This identifies whether the current session is interactive or not, and consequently sets the level of verbosity. This can be overridden by calling show_tracebacks() with True.

exception finesse.exceptions.IllegalSelfReferencing(message, **kwargs)[source]

Bases: FinesseException

Raised by elements who do not allow self referencing for arg/kwarg values.

exception finesse.exceptions.InvalidRTLError(message, **kwargs)[source]

Bases: FinesseException

Thrown when the RTL parameters of a Surface component violate energy conservation.

exception finesse.exceptions.LostLock(message, **kwargs)[source]

Bases: FinesseException

Thrown when the lock is lost by the locking algorithm. This is typically an issue of:

  • the error signal has been lost (no longer linear, rotated into a different quadrature

  • The error signal slope has become too small (need more lock gain) or too large (need less lock gain)

  • multiple locks are competing and dragging the interferometer to an unstable state.

In such cases you can run the lock action with the flag exception_on_fail=False to ensure it returns a finesse.analysis.actions.locks.RunLocksSolution. This solution can then be used to diagnose the issue, plot_error_signals and plot_control_signals are useful for this to see which error signals are causing an issue.

exception finesse.exceptions.ModelAttributeError(message, **kwargs)[source]

Bases: FinesseException

exception finesse.exceptions.ModelClassAttributeError(target: Any, resolved_attrs: list[str], missing_name: str)[source]

Bases: ModelAttributeError

Error indicating that a model path resolves to a class attribute.

E.g. l1.P.__dict__ or parse will resolve, but no usecase exists for referencing these class attributes in katscript.

exception finesse.exceptions.ModelMissingAttributeError(target: Any, resolved_attrs: list[str], missing_name: str)[source]

Bases: ModelAttributeError

Error indicating a model path was not found.

Model paths can be e.g. l1.P or s1.p1.o.

This exists mainly so it can be caught by the parser.

exception finesse.exceptions.ModelParameterDefaultValueError(element)[source]

Bases: FinesseException

Error indicating a model element has no default model parameter.

Some model parameters have defaults, such that they can be referenced in kat script using e.g. myvar instead of myvar.value. This error indicates a model element without such a default was referenced directly.

exception finesse.exceptions.ModelParameterSelfReferenceError(value, parameter)[source]

Bases: FinesseException

Error indicating a model parameter cannot be set to refer to itself.

exception finesse.exceptions.NoABCDCoupling(message, **kwargs)[source]

Bases: FinesseException

Raised when an ABCD coupling at a component is requested but does not exist.

exception finesse.exceptions.NoCouplingError(message, **kwargs)[source]

Bases: FinesseException

Raised when a coupling at a component is requested but does not exist.

exception finesse.exceptions.NoLinearEquations(message, **kwargs)[source]

Bases: FinesseException

Thrown when a simulation has no linear equations to solve.

exception finesse.exceptions.NodeException(message, node=None)[source]

Bases: FinesseException

Exception associated with Node related run-time errors.

Objects of type NodeException store the error message as well as an optional reference to the node(s) which caused the exception to be raised.

Parameters

messagestr

The error message.

nodeNode, optional

A reference to the offending node(s), defaults to None. This can be a single node or a sequence of nodes.

property node[source]

The node(s) responsible for raising this exception instance.

Getter:

Returns the node(s) (either a single Node object or a sequence of these objects) responsible for the exception (read-only).

exception finesse.exceptions.NotChangeableDuringSimulation(message, **kwargs)[source]

Bases: FinesseException

Thrown when a parameter is attempted to be changed during a simulation but is marked as not changeable during a simulation.

exception finesse.exceptions.ParameterLocked(message: str | None = None, par: Parameter | None = None, add_unlock_tip: bool = True, **kwargs)[source]

Bases: FinesseException

exception finesse.exceptions.TotalReflectionError(message, from_node=None, to_node=None)[source]

Bases: FinesseException

Exception indicating total reflection of a beam at a component when performing beam tracing.

Parameters

messagestr

The error message.

from_node, to_nodeNode

References to the offending source and target nodes, respectively.

property coupling[source]

The tuple of (from, to) nodes responsible for the total reflection error.

Getter:

Returns the nodes responsible for the exception (read-only).