-
Notifications
You must be signed in to change notification settings - Fork 4
Description
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..