Skip to content

Commit 6cf22db

Browse files
committed
fix object creation
1 parent 6893b94 commit 6cf22db

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

python/sixtracklib/beam_elements.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ def __init__(self, order=None, knl=None, ksl=None, bal=None, **kwargs):
103103
kwargs["bal"] = bal
104104
kwargs["order"] = order
105105

106-
elif bal is not None and bal and len(bal) > 2 and ((len(bal) % 2) == 0):
106+
elif bal is not None and len(bal) > 0:
107107
kwargs["bal"] = bal
108-
kwargs["order"] = (len(bal) - 2) / 2
108+
kwargs["order"] = (len(bal) - 2) // 2
109109

110110
super().__init__(**kwargs)
111111

@@ -286,9 +286,9 @@ class SRotation(CObject):
286286

287287
def __init__(self, angle=0, **nargs):
288288
anglerad = angle / 180 * np.pi
289-
cos_z = np.cos(anglerad)
290-
sin_z = np.sin(anglerad)
291-
super().__init__(cos_z=cos_z, sin_z=sin_z, **nargs)
289+
nargs['cos_z']=np.cos(anglerad)
290+
nargs['sin_z']=np.sin(anglerad)
291+
super().__init__(**nargs)
292292

293293
@property
294294
def angle(self):

0 commit comments

Comments
 (0)