element_parameters module

Define a base class for ElementBeamCalculatorParameters.

It is an attribute of an Element, and holds parameters that depend on both the Element under study and the BeamCalculator solver that is used.

Currently, it is used by Envelope1D and Envelope3D only, as TraceWin handles it itself.

class ElementBeamCalculatorParameters[source]

Bases: ABC

Parent class to hold solving parameters. Attribute of Element.

Used by Envelope1D and Envelope3D.

s_in: int
s_out: int
has(key)[source]

Tell if the required attribute is in this class.

Parameters:

key (str)

Return type:

bool

get(*keys, to_numpy=True, **kwargs)[source]

Get attributes from this class.

Parameters:
  • *keys (Literal['abs_mesh', 'd_z', 'n_steps', 'rel_mesh', 's_in', 's_out', 'transf_mat_function']) – One or more attribute names to retrieve.

  • to_numpy (bool, default: True) – If True, convert lists to NumPy arrays. If False, convert NumPy arrays to lists.

  • **kwargs (Any) – Reserved for future extensions.

Returns:

A single value if one key is given, or a tuple of values.

Return type:

Any

abstractmethod re_set_for_broken_cavity()[source]

Update solver after a cavity is broken.

Return type:

None | Callable

_abc_impl = <_abc._abc_data object at 0x7318faa95880>