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

apply_madx_errors with non-unique names in Line #52

Open
aoeftiger opened this issue Aug 21, 2020 · 0 comments
Open

apply_madx_errors with non-unique names in Line #52

aoeftiger opened this issue Aug 21, 2020 · 0 comments

Comments

@aoeftiger
Copy link

aoeftiger commented Aug 21, 2020

When a Line contains several elements with the same name, apply_madx_errors will overwrite only the first occurrence (repeatedly) with the present implementation (after merging PR #37 ).

It would be good to increment a counter for each name occurrence to automatically assign the error to the next element in line with the same name.

E.g. for Line.element_names = ["MB", "M", "MB"] and an error table with two different error vectors for "MB", the algorithm would apply the first error to the first "MB" occurrence (i.e. Line.elements[0]) and then the second one to the second occurrence, accordingly, (i.e. Line.elements[2]).

One way to implement this could be by using a list of indices of the occurrences for each name and then List.poping indices that have been assigned already..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant