Skip to content

WIP: Yaml-configured BeamlineObject

Marcus Oskarsson requested to merge github/fork/rhfogh/BeamlineObject2 into master

Created by: rhfogh

This is a new proposal for the beamline object, with yaml configuration.

There is still a fair bit to do, but before I add functionality, try to extend this to e.g. the diffractometer, or modify the code to fit the new system, we should agree if this is indeed the way to go.

Comments

  • The framework will support configuration of any contained object, so I propose it could eventually become a replacement for HardwareObjectNode. I have therefore put it in HardwareRepository and BaseHardwareObjects. For a start (transition phase?) it should support both yaml-configured objects and xml-configured HardwareObjects as contained objects.

  • All contained objects must be defined as properties, with a single role name per object. They are optional, so you can simply omit them from the configuration file. This is not limited to HardwareObjects, you could configure e.g. AcquisitionParameter objects.

  • The BeamlineObject (and any other object that uses the framework) can be subclassed - you just need to add any additional properties and update a single short function in the subclass

  • Each object belongs to one (and only one) category, and you can get objects by category. That allows you to define and get e.g. all procedures or all centring functions.

  • You can put lists, maps, or scalars in as non-object properties. These do not have to be defined as properties, but for safety the corresponding attribute has to be set in the class.__init__

TODO

  • DONE Check the ruamel.yaml module, which looks like a better replacement for standard yaml (which has a lot of gotchas) (ACTION @rhfogh )

  • DONE Check the yaml formatting we want and the dump options this corresponds to, and rewrite the example to match. (ACTION @rhfogh)

  • Add output for loaded objects (with load time), failed loads, and non-configured objects. (ACTION @rhfogh)

Merge request reports