Skip to content

Commit

Permalink
Replace "math" with "numpy" library for optimise
Browse files Browse the repository at this point in the history
  • Loading branch information
tbody-cfs committed Nov 13, 2023
1 parent d562e32 commit 52189ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions freegs/optimise.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import matplotlib.pyplot as plt
from freegs.plotting import plotEquilibrium

from math import sqrt
from numpy import sqrt, inf

# Measures which operate on Equilibrium objects

Expand Down Expand Up @@ -199,7 +199,7 @@ def solve_and_measure(eq):
return measure(eq)
except:
# Solve failed.
return float("inf")
return float(inf)

# Call the generic optimiser,
return optimiser.optimise(
Expand Down

0 comments on commit 52189ad

Please sign in to comment.