(params: np.ndarray, bounds: List)
Rescale samples in 0-to-1 range to arbitrary bounds

    Parameters
    ----------
    params : numpy.ndarray
        numpy array of dimensions `num_params`-by-:math:`N`,
        where :math:`N` is the number of samples

    bounds : list
        list of lists of dimensions `num_params`-by-2
Rescale samples in 0-to-1 range to arbitrary bounds
Rescale samples in 0 - to - 1 range to arbitrary bounds
def _scale_samples(params: np.ndarray, bounds: List):
    """Rescale samples in 0-to-1 range to arbitrary bounds

    Parameters
    ----------
    params : numpy.ndarray
        numpy array of dimensions `num_params`-by-:math:`N`,
        where :math:`N` is the number of samples

    bounds : list
        list of lists of dimensions `num_params`-by-2
    """
    # Check bounds are legal (upper bound is greater than lower bound)
    lower_bounds, upper_bounds = _check_bounds(bounds)

    if np.any(lower_bounds >= upper_bounds):
        raise ValueError("Bounds are not legal (upper bound must be greater than lower bound)")

    # This scales the samples in-place, by using the optional output
    # argument for the numpy ufunctions
    # The calculation is equivalent to:
    #   sample * (upper_bound - lower_bound) + lower_bound
    np.add(np.multiply(params,
                       (upper_bounds - lower_bounds),
                       out=params),
           lower_bounds,
           out=params)
def _scale_samples ( params : np . ndarray , bounds : List ) : # Check bounds are legal (upper bound is greater than lower bound) lower_bounds , upper_bounds = _check_bounds ( bounds ) if np . any ( lower_bounds >= upper_bounds ) : raise ValueError ( "Bounds are not legal (upper bound must be greater than lower bound)" ) # This scales the samples in-place, by using the optional output # argument for the numpy ufunctions # The calculation is equivalent to: #   sample * (upper_bound - lower_bound) + lower_bound np . add ( np . multiply ( params , ( upper_bounds - lower_bounds ) , out = params ) , lower_bounds , out = params )