desy-ml / cheetah

Fast and differentiable particle accelerator optics simulation for reinforcement learning and optimisation applications.
https://cheetah-accelerator.readthedocs.io
GNU General Public License v3.0
25 stars 12 forks source link

Dipole element name overwriting #181

Closed jp-ga closed 2 weeks ago

jp-ga commented 2 weeks ago

I was checking dipole.py and saw this: https://github.com/desy-ml/cheetah/blob/ff3430b25dac3d62c8515313d014d29fafff6b02/cheetah/accelerator/dipole.py#L77

It might be overwriting the name generated from the Element class init : https://github.com/desy-ml/cheetah/blob/ff3430b25dac3d62c8515313d014d29fafff6b02/cheetah/accelerator/element.py#L37

jank324 commented 2 weeks ago

Yeah ... I think this is an issue and the line in dipole.py should be removed. We should also check if other elements do the same thing.