name_from_internal

name_from_internal(element_name)[source]

Convert element name from internal representation to user API. Example:

>>> name_from_internal("foo:1")
foo
:rtype: :sphinx_autodoc_typehints_type:`\:py\:class\:\`str\``
>>> name_from_internal("foo:2")
foo[2]

Element names are stored with a “:d” suffix by MAD-X internally (data in node/sequence structs), but users must use the syntax “elem[d]” to access the corresponding elements. This function is used to transform any string coming from the user before passing it to MAD-X.