pyaml.arrays.serialized_magnet#
Serialized Magnet module.
This module provides serialized magnet functionality.
Classes
|
Serialized magnets array configuration. |
- class pyaml.arrays.serialized_magnet.SerializedMagnets(name, elements)#
Bases:
ArrayConfig,DynamicValidationSerialized magnets array configuration.
- Parameters:
name (str) – Name under which the array is registered and later looked up.
elements (list[str]) – Element name patterns making up the array: literal names,
fnmatchwildcards, orre:regular expressions.
Methods
Fill the serialized magnet array in the element holder.
Examples
A magnet array configuration can also be created by code using the following example:
from pyaml.arrays.serialized_magnet import SerializedMagnets from pyaml.arrays.serialized_magnet import ConfigModel as SerializedMagnetConfigModel magArray = SerializedMagnets( SerializedMagnetConfigModel(name="mySerializedMagnets", elements=["mag1","mag2"]) )
- fill_array(holder)#
Fill the serialized magnet array in the element holder.
- Parameters:
holder (ElementHolder) – The element holder to populate with serialized magnet array