Skip to content

Commit

Permalink
Allow insert on top of marker
Browse files Browse the repository at this point in the history
  • Loading branch information
giadarol committed Feb 3, 2023
1 parent e9468e5 commit 15e5e52
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions xtrack/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ def insert_element(self, index=None, element=None, name=None, at_s=None,
for ii in range(i_first_drift_to_cut, i_last_drift_to_cut+1):
e_to_replace = self.element_dict[self.element_names[ii]]
if (not _is_drift(e_to_replace) and
not isinstance(e_to_replace, Marker) and
not e_to_replace.__class__.__name__.startswith('Limit')):
raise ValueError('Cannot replace active element '
f'{self.element_names[ii]}')
Expand Down

0 comments on commit 15e5e52

Please sign in to comment.