Open awegsche opened 1 year ago
And the output of the phase calculation could also benfit from a struct
.
Comments:
InputFiles
is not used before it is defined, in the sense that this is a bug. It is used after it's definition Runtime wise, i.e. a readability problem, not an operational one.
There are no struct
s in Python, at least none that IMHO make sense here. I guess you mean dataclass
?
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 inmeasure_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.