Skip to content

Commit

Permalink
Merge pull request #76 from tbody-cfs/fix-ndarray-item
Browse files Browse the repository at this point in the history
Replace deprecated np.asscalar
  • Loading branch information
bendudson committed Dec 14, 2022
2 parents 4e233b7 + 1163b58 commit 937c01f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions freegs/equilibrium.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def q(self, psinorm=None, npsi=100):
result = critical.find_safety(self, psinorm=psinorm)
# Convert to a scalar if only one result
if len(result) == 1:
return np.asscalar(result)
return result[0]
return result

def tor_flux(self, psi=None):
Expand All @@ -366,7 +366,7 @@ def tor_flux(self, psi=None):

# Convert to a scalar if only one result
if len(result) == 1:
return np.asscalar(result)
return result[0]
return result

def rhotor(self, psi=None):
Expand All @@ -388,7 +388,7 @@ def rhotor(self, psi=None):
result = np.sqrt(torflux / max_torflux)

if len(result) == 1:
return np.asscalar(result)
return result[0]
return result

def pprime(self, psinorm):
Expand Down

0 comments on commit 937c01f

Please sign in to comment.