fides/minimize.py
def check_in_bounds(self, x: Optional[np.ndarray] = None):
        """
        Checks whether the current optimization variables are all within the
        specified boundaries

        :raises:
            RuntimeError if any of the variables are not within boundaries
        """
        if x is None:
            x = self.x

        if self.iteration == 0:
            pointstr = 'at initial point.'
        else:
            pointstr = f'at iteration {self.iteration}.'

        for ref, sign, name in zip([self.ub, self.lb],
                                   [-1.0, 1.0],
                                   ['upper bounds', 'lower bounds']):
            diff = sign * (ref - x)
            if not np.all(diff <= 0):
                ix = np.where(diff > 0)[0]
                self.exitflag = ExitFlag.EXCEEDED_BOUNDARY
                raise RuntimeError(f'Exceeded {name} for indices {ix} by '
                                   f'{diff[ix]} {pointstr}')

        Checks whether the current optimization variables are all within the
        specified boundaries

        :raises:
            RuntimeError if any of the variables are not within boundaries
        
Checks whether the current optimization variables are all within the
specified boundaries
Checks whether the current optimization variables are all within the specified boundaries
def check_in_bounds(self, x: Optional[np.ndarray] = None):
        if x is None:
            x = self.x
        if self.iteration == 0:
            pointstr = 'at initial point.'
        else:
            pointstr = f'at iteration {self.iteration}.'
        for ref, sign, name in zip([self.ub, self.lb],
                                   [-1.0, 1.0],
                                   ['upper bounds', 'lower bounds']):
            diff = sign * (ref - x)
            if not np.all(diff <= 0):
                ix = np.where(diff > 0)[0]
                self.exitflag = ExitFlag.EXCEEDED_BOUNDARY
                raise RuntimeError(f'Exceeded {name} for indices {ix} by '
                                   f'{diff[ix]} {pointstr}')
def check_in_bounds ( self , x : Optional [ np . ndarray ] = None ) : if x is None : x = self . x if self . iteration == 0 : pointstr = 'at initial point.' else : pointstr = f'at iteration {self.iteration}.' for ref , sign , name in zip ( [ self . ub , self . lb ] , [ - 1.0 , 1.0 ] , [ 'upper bounds' , 'lower bounds' ] ) : diff = sign * ( ref - x ) if not np . all ( diff <= 0 ) : ix = np . where ( diff > 0 ) [ 0 ] self . exitflag = ExitFlag . EXCEEDED_BOUNDARY raise RuntimeError ( f'Exceeded {name} for indices {ix} by ' f'{diff[ix]} {pointstr}' )
Checks whether the current optimization variables are all within the
specified boundaries
Checks whether the current optimization variables are all within the specified boundaries
"""
        Checks whether the current optimization variables are all within the
        specified boundaries

        :raises:
            RuntimeError if any of the variables are not within boundaries
        """
RuntimeError if any of the variables are not within boundaries
RuntimeError if any of the variables are not within boundaries
self
x
Optional[np.ndarray]