cfm_magnet#

class ConfigModel(*, name, elements)[source]#

Bases: ArrayConfigModel

Configuration model for Combined Function Magnet array.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

class CombinedFunctionMagnet(cfg)[source]#

Bases: ArrayConfig

Combined function magnet array confirguration

Example

A magnet array configuration can also be created by code using the following example:

from pyaml.arrays.cfm_magnet import CombinedFunctionMagnet
from pyaml.arrays.cfm_magnet import ConfigModel as CFMagnetConfigModel
magArray = CombinedFunctionMagnet(
             CFMagnetConfigModel(name="myCFM", elements=["mag1","mag2"])
           )
fill_array(holder)[source]#

Fill the combined function magnet array in the element holder.

Parameters:

holder (ElementHolder) – The element holder to populate with combined function magnet array