Skip to content

Commit 7832b16

Browse files
authored
Merge pull request #705 from babreufig/bugfix/madx_sequence
Add error message if element is unsupported to convert to MAD
2 parents 0d425eb + 41fa14f commit 7832b16

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

xtrack/mad_writer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,8 @@ def element_to_mad_str(
565565
tokens = xsuite_to_mad_converters[el._parent.__class__](eref, mad_type=mad_type, substituted_vars=substituted_vars)
566566
if isinstance(el, xt.beam_elements.slice_elements_edge._ThinSliceEdgeBase):
567567
tokens.append(mad_assignment('kill_body', True, mad_type, substituted_vars=substituted_vars))
568+
else:
569+
raise NotImplementedError(f"Element of type {el.__class__} not supported yet in MAD writer")
568570
else:
569571
tokens = xsuite_to_mad_converters[el.__class__](eref, mad_type=mad_type, substituted_vars=substituted_vars)
570572

0 commit comments

Comments
 (0)