rdemaria / pysixtrack

Reference sixtrack tracking engine in pure python
Apache License 2.0
1 stars 12 forks source link

Multipole knl & ksl extensibility #27

Open aoeftiger opened 5 years ago

aoeftiger commented 5 years ago

For an instantiated elements.Multipole, it'd be really useful to assign higher-order magnet strengths even if they were not declared at instantiation.

e.g.

m = pysixtrack.elements.Multipole(knl=[0])
m.knl[1] = 1e-2 # currently raises an IndexError

This could be implemented based on abc.Sequence similarly to the cpymad.madx.ArrayAttribute approach -- which comes in really handy in cpymad.

This feature would be useful for manipulation of Multipoles in particular in view of adding error components to an existing lattice.