Skip to content

Commit

Permalink
Update docs/source/dev/configuration_files.md
Browse files Browse the repository at this point in the history
Co-authored-by: fabcor <[email protected]>
  • Loading branch information
rhfogh and fabcor-maxiv authored Mar 15, 2024
1 parent 34afde2 commit fe3616a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/dev/configuration_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Configuration files are searched for by name in a series of directories given as

## Yaml-configured objects
### Code and file structure
Each yaml-configured object has a 'name' attribute, which is equal to the role that identifies the object within the containing object (the name of the Beamline object is 'beamline').
Each YAML-configured object has a `name` attribute, which is equal to the role that identifies the object within the containing object (the name of the Beamline object is `beamline`).

Yaml-configured objects must be subclasses of the BaseHardwareObjects.ConfiguredObject class. The most complete example is the Beamline object and the comments in beamline_config.yml are the best guide to the syntax of yaml configuration files. It is a key principle of yaml-configured classes that **all** attributes added in the configuration must match a pre-defined attribute coded in the class. This means that you can look in the class code to see which attributes are available. The only exceptinon is the *_initialise_class* attribute at the start of the file. This dictionary contains the import name of the class that is to be created, and optionally parameters to be passed to the init() function of that class. The *_objects* attribute gives the HardwareObjects that are contained in (i.e. children of) the object. The dictionary key is the role name, and the value is the name of the configuration file. Each role_name must match a read-only property coded in the body of the class, and must be added to the *__content_roles* list of the class by the class code. Note that classes are loaded and initialised in the order given by this list, so that there is a reproducible loading order. Contained objects can be defined as procedures, so that they are added to the list of procedures. Each Yaml-configured class has an _init() function that is executed immediately after the object is created, and and init() function that is executed after configured parameters and contained objects have been loaded.

Expand Down

0 comments on commit fe3616a

Please sign in to comment.