Skip to content

Commit

Permalink
Merge pull request #138 from rdemaria/fix_be_creation
Browse files Browse the repository at this point in the history
fix object creation
  • Loading branch information
rdemaria authored Dec 17, 2020
2 parents 6893b94 + 6cf22db commit 42b4f06
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/sixtracklib/beam_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ def __init__(self, order=None, knl=None, ksl=None, bal=None, **kwargs):
kwargs["bal"] = bal
kwargs["order"] = order

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

super().__init__(**kwargs)

Expand Down Expand Up @@ -286,9 +286,9 @@ class SRotation(CObject):

def __init__(self, angle=0, **nargs):
anglerad = angle / 180 * np.pi
cos_z = np.cos(anglerad)
sin_z = np.sin(anglerad)
super().__init__(cos_z=cos_z, sin_z=sin_z, **nargs)
nargs['cos_z']=np.cos(anglerad)
nargs['sin_z']=np.sin(anglerad)
super().__init__(**nargs)

@property
def angle(self):
Expand Down

0 comments on commit 42b4f06

Please sign in to comment.