pylhc / omc3

Python 3 codes for beam optics measurements and corrections in circular particle accelerators
https://pylhc.github.io/omc3/
MIT License
14 stars 7 forks source link

[Feature Request]: Structured Data #402

Open awegsche opened 1 year ago

awegsche commented 1 year ago

Feature Description

As mentionned in one previous pull request, the code could benefit from more structured data. Where it might be overkill to create and entire struct just to get rid of one replace(':', '/'), there are places in omc3 where it would actually make sense and improve usability of the code.

One important place to start would be InputFiles .

Possible Implementation

First of all, InputFiles should go into a separate file (right now it's even used before it's defined in measure_optics.py).

Then, the data should not be stored as dict for 'X' and 'Y', but have members .x_files/.y_files. If access to those members is desired from the outside, for convenience and to keep compatibility, the [] operator can be overriden.

awegsche commented 1 year ago

And the output of the phase calculation could also benfit from a struct.

JoschD commented 1 year ago

Comments: