String representation - #351
Conversation
|
Thanks ! Yes for very long representation we used pydantic feature attached_to(self) -> str:
"""
Returns a string of which peer the element is attached to.
"""
return "None" if self._peer is None else f"{self._peer.__class__.__name__}:{self._peer.name()}"Concerning devices x_pos,..., I think we should remove the |
|
@JeanLucPons @GamelinAl including properties like x_pos "publically" would also solve #44 and give control system access easily. For example (preudocode that may contain mistakes, |
|
In case of `public' x_pos, y_pos, tilt_name, x_offset, y_offset we also can remove the get_X_device functions, right? |
|
I also remarked issue with from pyaml.accelerator import Accelerator
sr = Accelerator.load("tests/config/EBSOrbit.yaml")
print(sr.design.magnet.get("QF6B-C04"))I works better with IdentityCFMagnetModel but powerconverters (or physics) are not printed. from pyaml.accelerator import Accelerator
sr = Accelerator.load("tests/config/EBSOrbit.yaml")
print(sr.design.magnet.get("SJ2E-C04-H")) |
Work in progress!
Modified pyaml_repr to print nested string representation. For BPM, this gives better results.
There are a few issues still that can be resolved in different ways.
When solved resolves #345