-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
We need proper string representations for pyAML objects, implementing both __repr__ and __str__ methods.
Here is some proposal for key elements:
For example for pyaml.lattice.magnet
__repr__Method:- Should include both the
nameand thecontrol_mode(e.g.,simulatedvs.live) to avoid confusion.
- Should include both the
__str__Method:- Should print detailed information about the magnet, e.g.:
Sextupole(name='SXF2', strength=809.008, currents=[140,...], hardware_name='AN01-AR/EM/SCF.02', control_mode='live', ...)
- Should print detailed information about the magnet, e.g.:
For pyaml.instrument.Instrument
__repr__Method:- Should include the instrument name (given in the configuration).
__str__Method:- Should include the instrument name (given in the configuration) and the name of the configuration file read (if any).
For tango.pyaml.controlsystem
__repr__Method:- Should include the instrument name and the control system type.
__str__Method:- Should include all of the above plus tango_host (for
tango.pyaml.controlsystem.TangoControlSystem).
- Should include all of the above plus tango_host (for
For pyaml.lattice.simulator.Simulator
__repr__Method:- Should include the instrument name, the control system type.
__str__Method:- Should include all of the above plus the lattice name and energy.
For RWStrengthScalar and similar classes
__repr__Method:- Should include the linked property name (corresponding to
model.get_devices()[0].name()) and unit.
- Should include the linked property name (corresponding to
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels