Skip to content

Commit 7f20a22

Browse files
committed
Add key word arguments to BunchWrapTEAPOT
1 parent 17a3728 commit 7f20a22

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

examples/TEAPOT/test_nodes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ def test_monitor():
2222
name = "name"
2323
node = teapot.MonitorTEAPOT(name=name)
2424
assert node.getName() == name
25+
26+
27+
def test_bunch_wrap():
28+
ringlength = 100.0
29+
node = teapot.BunchWrapTEAPOT(ringlength=ringlength)
30+
assert node.getParam("ring_length") == ringlength

py/orbit/teapot/teapot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,13 +650,13 @@ class BunchWrapTEAPOT(NodeTEAPOT):
650650
Drift TEAPOT element.
651651
"""
652652

653-
def __init__(self, name: str = "drift no name") -> None:
653+
def __init__(self, name: str = "drift no name", ringlength: float = 0.0) -> None:
654654
"""
655655
Constructor. Creates the Bunch wrapper TEAPOT element used in Ring lattices.
656656
"""
657657
NodeTEAPOT.__init__(self, name)
658658
self.setType("bunch_wrap_teapot")
659-
self.addParam("ring_length", 0.0)
659+
self.addParam("ring_length", ringlength)
660660

661661
def track(self, paramsDict: dict) -> None:
662662
"""

0 commit comments

Comments
 (0)