Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
cd4af4f
Write example notebook on implementing custom elements
jank324 Jul 24, 2025
faa4748
Add changelog entry
jank324 Jul 24, 2025
10e4419
Merge branch 'master' into 396-add-example-on-how-to-implement-custom…
jank324 Aug 4, 2025
f36b35b
Move changelog entry to new version
jank324 Aug 4, 2025
627848a
Merge branch 'master' into 396-add-example-on-how-to-implement-custom…
jank324 Aug 4, 2025
0b87878
Merge branch 'master' into 396-add-example-on-how-to-implement-custom…
jank324 Jul 3, 2026
b7de1a0
Fix line lengths
jank324 Jul 3, 2026
b46c68d
Fix duplicate "the"
jank324 Jul 3, 2026
bb33207
FIx spelling of "transformation"
jank324 Jul 3, 2026
d11d07f
Fix spelling of "usually"
jank324 Jul 3, 2026
9cd181b
Fix parameters in `__init__` not matching docstring
jank324 Jul 3, 2026
a11ea1e
Update example to updates that have been done in Cheetah since this P…
jank324 Jul 3, 2026
495d42c
Add `dtype` and `device` docstrings everywhere
jank324 Jul 3, 2026
40e82d8
Added `clone` as per the comment by @Hespe
jank324 Jul 3, 2026
59ebbf7
Potential fix for pull request finding
jank324 Jul 3, 2026
49e4964
Potential fix for pull request finding
jank324 Jul 3, 2026
aecb1b7
Potential fix for pull request finding
jank324 Jul 3, 2026
4a44add
Merge branch 'master' into 396-add-example-on-how-to-implement-custom…
jank324 Jul 16, 2026
fd59fc2
Add note and conversion and serialisation
jank324 Jul 16, 2026
474b8ac
Spelling
jank324 Jul 16, 2026
c29cc4a
Fix text formatting of serialisation and conversion information
jank324 Jul 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscode/ltex.dictionary.en-GB.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ Shenoy
EuXFEL
dtype
DOOCS
subclassing
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
### 🐆 Other

- Non-deterministic torch features now raise a warning in tests instead of a failure. This also fixes a test failure introduced by changes on the MPS backend in PyTorch 2.13. (see #655) (@Hespe, @jank324)
- Add example notebook on implementing custom elements to documentation (see #522) (@jank324)

### 🌟 First Time Contributors

Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/aperture.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class Aperture(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

def __init__(
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/bpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class BPM(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

def __init__(
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/cavity.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class Cavity(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

def __init__(
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/combined_corrector.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class CombinedCorrector(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

supported_tracking_methods = ["linear"]
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/custom_transfer_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class CustomTransferMap(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

supported_tracking_methods = ["linear"]
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/dipole.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class Dipole(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

supported_tracking_methods = ["linear", "second_order", "drift_kick_drift"]
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/drift.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class Drift(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

supported_tracking_methods = ["linear", "second_order", "drift_kick_drift"]
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/horizontal_corrector.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class HorizontalCorrector(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

supported_tracking_methods = ["linear"]
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/marker.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class Marker(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

def __init__(
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/quadrupole.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class Quadrupole(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

supported_tracking_methods = ["linear", "second_order", "drift_kick_drift"]
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/rbend.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class RBend(Dipole):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

def __init__(
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class Screen(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

def __init__(
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class Segment(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

def __init__(
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/sextupole.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class Sextupole(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

supported_tracking_methods = ["linear", "second_order"]
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/solenoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class Solenoid(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

supported_tracking_methods = ["linear"]
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/space_charge_kick.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class SpaceChargeKick(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

def __init__(
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/superimposed.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class Superimposed(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

def __init__(
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/transverse_deflecting_cavity.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class TransverseDeflectingCavity(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

supported_tracking_methods = ["drift_kick_drift"]
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/undulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class Undulator(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

supported_tracking_methods = ["linear"]
Expand Down
2 changes: 2 additions & 0 deletions cheetah/accelerator/vertical_corrector.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class VerticalCorrector(Element):
element (e.g. control-system addresses or PVs). This information is *not* used
in simulation and may contain any extra data the user wants to store along with
the lattice. See :doc:`/examples/including_metadata` for more information.
:param device: Device on which to create the element's tensors.
:param dtype: Data type of the element's tensors.
"""

supported_tracking_methods = ["linear"]
Expand Down
Loading
Loading