Skip to content

Commit

Permalink
use py opt warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewellis55 committed Oct 6, 2024
1 parent bbc1c6f commit bdb6283
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyoptsparse/pySLSQP/pySLSQP.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import datetime
import os
import time
import warnings
from ..pyOpt_error import pyOptSparseWarning

# External modules
import numpy as np
Expand Down Expand Up @@ -168,8 +168,8 @@ def __call__(
# =================================================================
def slfunc(m, me, la, n, f, g, x):
if (x < blx).any() or (x > bux).any():
warnings.warn("Values in x were outside bounds during a "
"minimize step, clipping to bounds", RuntimeWarning)
pyOptSparseWarning("Values in x were outside bounds during"
" a minimize step, clipping to bounds")YY
fobj, fcon, fail = self._masterFunc(np.clip(x, blx, bux), ["fobj", "fcon"])
f = fobj
g[0:m] = -fcon
Expand Down

0 comments on commit bdb6283

Please sign in to comment.