experimental.test module
Define simple tests for functionality under implementation.
- class Generic(preset: str, property_1: ndarray)
Bases:
object
A generic class.
- __init__(preset: str, property_1: ndarray) None
- __post_init__()
Write a doc.
- classmethod from_truc(truc: str, property_2: ndarray) Self
Make the doc.
- preset: str
- property_1: ndarray
- property property_1_pos: ndarray
Write a doc.
- class Initial(preset: str, property_1: tuple[float, float])
Bases:
Generic
Write a doc.
- __init__(preset: str, property_1: tuple[float, float]) None
- __post_init__()
Write a doc.
- property_1: tuple[float, float]
- property property_1_pos: float
Write a doc.
- assert_are_field_maps(elements: Sequence[Element], detail: str) None
Test that all elements are field maps.
This function exists because in first implementations of LightWin, only FIELD_MAP could be broken/retuned, and all FIELD_MAP were 1D along z. Hence there was a confustion between what is/should be a cavity, an accelerating elementm what could be broken, what could be used for compensation. Also useful to identify where bugs will happen when implementing tuning of quadrupoles, etc.
- Parameters:
elements (Sequence[Element]) – List of elements to test.
detail (str) – More information that will be printed if not all elements are field maps.