def _check_bounds()

in bayesmark/random_search.py [0:0]


def _check_bounds(bounds, n_params):  # pragma: validator
    """Input validation for `suggest` routine."""
    if not (np.shape(bounds) == (n_params, 2)):
        raise ValueError("bounds must have shape %s not %s." % (str((n_params, 2)), str(np.shape(bounds))))

    lb, ub = np.asarray(bounds).T
    if not (np.all(np.isfinite(lb)) and np.all(np.isfinite(ub))):
        raise ValueError("bounds must be finite.")
    if not (np.all(lb <= ub)):
        raise ValueError("lower bound must be less than upper bound.")
    return lb, ub