Skip to content

Commit

Permalink
refactors np.Inf -> np.inf, in accordance with deprecation in upcomin…
Browse files Browse the repository at this point in the history
…g NumPy 2.0
  • Loading branch information
peterdsharpe committed Apr 3, 2024
1 parent e65fb28 commit 809aea9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def augmented_objective(x):
repanel=False
)
if np.isnan(xfoil["Cd"]).any():
return np.Inf
return np.inf

objective = np.sqrt(np.mean(xfoil["Cd"] ** 2)) # RMS

Expand Down
2 changes: 1 addition & 1 deletion aerosandbox/aerodynamics/aero_3D/aero_buildup.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def wing_aerodynamics(self,
)
half_span = sum(sectional_spans)
if len(wing.xsecs) > 0:
span_inboard_to_YZ_plane = np.Inf
span_inboard_to_YZ_plane = np.inf
for i in range(len(wing.xsecs)):
span_inboard_to_YZ_plane = np.minimum(
span_inboard_to_YZ_plane,
Expand Down
4 changes: 2 additions & 2 deletions aerosandbox/geometry/wing.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def span(self,

if include_centerline_distance and len(self.xsecs) > 0:

half_span_to_XZ_plane = np.Inf
half_span_to_XZ_plane = np.inf

for i in i_range:
half_span_to_XZ_plane = np.minimum(
Expand Down Expand Up @@ -403,7 +403,7 @@ def area(self,

if include_centerline_distance and len(self.xsecs) > 0:

half_span_to_centerline = np.Inf
half_span_to_centerline = np.inf

for i in range(len(self.xsecs)):
quarter_chord_location = self._compute_xyz_of_WingXSec(
Expand Down
2 changes: 1 addition & 1 deletion aerosandbox/tools/pretty_plots/plots/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def contour(
extendrect: bool = True,
linelabels_format: Union[str, Callable[[float], str]] = eng_string,
linelabels_fontsize: float = 8,
max_side_length_nondim: float = np.Inf,
max_side_length_nondim: float = np.inf,
colorbar_label: str = None,
x_log_scale: bool = False,
y_log_scale: bool = False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(self,
[spline(spline.x[-1], 1)],
[spline(spline.x[-1])]
]),
x=np.array([np.Inf])
x=np.array([np.inf])
)

### Add spline knots for natural negative extrapolation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def solve_scipy_bfgs(N=10):
method="BFGS",
tol=1e-8,
options=dict(
maxiter=np.Inf,
maxiter=np.inf,
)
)

Expand Down Expand Up @@ -74,8 +74,8 @@ def solve_scipy_nm(N=10):
x0=get_initial_guess(N),
method="Nelder-Mead",
options=dict(
maxiter=np.Inf,
maxfev=np.Inf,
maxiter=np.inf,
maxfev=np.inf,
xatol=1e-8,
adaptive=True,
)
Expand Down

0 comments on commit 809aea9

Please sign in to comment.