Skip to content

apply_madx_errors with non-unique names in Line #52

@aoeftiger

Description

@aoeftiger

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..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions