accelerator#
Accelerator class
- class ConfigModel(*, facility, machine, energy, alphac=None, harmonic_number=None, controls=None, simulators=None, data_folder, description=None, arrays=None, devices)[source]#
Bases:
BaseModelConfiguration model for Accelerator
- Parameters:
facility (str) – Facility name
machine (str) – Accelerator name
energy (float) – Accelerator nominal energy. For ramped machine, this value can be dynamically set
alphac (float, optional) – Moment compaction factor.
harmonic_number (int, optional) – Number of bucket
controls (list[ControlSystem], optional) – List of control system used. An accelerator can access several control systems
data_folder (str) – Data folder
arrays (list[ArrayConfig], optional) – Element family
description (str , optional) – Acceleration description
devices (list[.common.element.Element]) – Element list
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.
- arrays: list[ArrayConfig]#
- controls: list[ControlSystem]#
- class Accelerator(cfg)[source]#
Bases:
objectPyAML top level class
- static from_dict(config_dict, ignore_external=False)[source]#
Construct an accelerator from a dictionary.
- static load(filename, use_fast_loader=False, ignore_external=False)[source]#
Load an accelerator from a config file.
- Parameters:
filename (str) – Configuration file name, yaml or json.
use_fast_loader (bool) – Use fast yaml loader. When specified, no line number are reported in case of error, only the element name that triggered the error will be reported in the exception)
ignore_external (bool) – Ignore external modules and return None for object that cannot be created. pydantic schema that support that an object is not created should handle None fields.
- add_device(config, ignore_external=False)[source]#
Dynamically add a device to this accelerator
- config_dictstr
Dictionary containing accelerator config
- ignore_external: bool
Ignore external modules and return None for object that cannot be created. pydantic schema that support that an object is not created should handle None fields.
- set_energy(E)[source]#
Set the energy for all simulators and control systems.
- Parameters:
E (float) – Energy value to set in eV
- set_mcf(alphac)[source]#
Set the moment compaction factor for all simulators and control systems.
- Parameters:
alphac (float) – Moment compaction factor
- property design: Simulator#
Get the design simulator.
- Returns:
Simulator – The design simulator instance
- property live: ControlSystem#
Get the live control system.
- Returns:
ControlSystem – The live control system instance
- property yellow_pages: YellowPages#