Skip to content

Commit

Permalink
Merge pull request #28 from jwscook/jwscook/numpy-update
Browse files Browse the repository at this point in the history
changed machine's self.Ns to an int, and followed numpy's deprecation…
  • Loading branch information
bendudson committed Mar 25, 2020
2 parents b3b4c06 + 8b88307 commit 24bde48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions freegs/machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def __init__(self, Rs, Zsmin, Zsmax, Ns, current=0.0, control=True):
self.Rs = Rs
self.Zsmin = Zsmin
self.Zsmax = Zsmax
self.Ns = Ns
self.Ns = int(Ns)

self.current = current
self.control = control
Expand Down Expand Up @@ -513,7 +513,7 @@ def controlAdjust(self, current_change):

for coil, dI in zip(controlcoils, current_change):
# Ensure that dI is a scalar
coil.current += np.asscalar(dI)
coil.current += dI.item()

def controlCurrents(self):
"""
Expand Down

0 comments on commit 24bde48

Please sign in to comment.