Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Structured Data #402

Open
awegsche opened this issue Oct 11, 2022 · 2 comments
Open

[Feature Request]: Structured Data #402

awegsche opened this issue Oct 11, 2022 · 2 comments
Labels
Type: Feature A (suggetion for a) new feature or enhancement in functionality.

Comments

@awegsche
Copy link
Contributor

awegsche commented Oct 11, 2022

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 awegsche added the Type: Feature A (suggetion for a) new feature or enhancement in functionality. label Oct 11, 2022
@awegsche
Copy link
Contributor Author

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

@JoschD
Copy link
Member

JoschD commented Oct 11, 2022

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 structs in Python, at least none that IMHO make sense here. I guess you mean dataclass?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature A (suggetion for a) new feature or enhancement in functionality.
Projects
None yet
Development

No branches or pull requests

2 participants