def check_args(self, x, xmin, xmax): x = numpy.array(x, numpy.float_) # Make a copy xmin = numpy.asarray(xmin, numpy.float_) # Make a copy xmax = numpy.asarray(xmax, numpy.float_) # Make a copy if (x.shape != xmin.shape) or (x.shape != xmax.shape): raise InputError(x, xmin, xmax) if _outside_limits(x, xmin, xmax): raise OutOfBoundErr(x, xmin, xmax) return x, xmin, xmax
def func_bounds_wrapper(x, *args): if _outside_limits(x, low, high): return numpy.inf return func(x, *args)