(params: np.ndarray, problem: Dict)
return params
Scale samples based on specified distribution (defaulting to uniform).

    Adds an entry to the problem specification to indicate samples have been
    scaled to maintain backwards compatibility (`sample_scaled`).

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

    Returns
    ----------
    np.ndarray, scaled samples
Scale samples based on specified distribution (defaulting to uniform).
Scale samples based on specified distribution ( defaulting to uniform ) .
def scale_samples(params: np.ndarray, problem: Dict):
    """Scale samples based on specified distribution (defaulting to uniform).

    Adds an entry to the problem specification to indicate samples have been
    scaled to maintain backwards compatibility (`sample_scaled`).

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

    Returns
    ----------
    np.ndarray, scaled samples
    """
    bounds = problem['bounds']
    dists = problem.get('dists')

    if dists is None:
        _scale_samples(params, bounds)
    else:
        if params.shape[1] != len(dists):
            msg = "Mismatch in number of parameters and distributions.\n"
            msg += "Num parameters: {}".format(params.shape[1])
            msg += "Num distributions: {}".format(len(dists))
            raise ValueError(msg)

        params = _nonuniform_scale_samples(
            params, bounds, dists)

    problem['sample_scaled'] = True

    return params
def scale_samples ( params : np . ndarray , problem : Dict ) : bounds = problem [ 'bounds' ] dists = problem . get ( 'dists' ) if dists is None : _scale_samples ( params , bounds ) else : if params . shape [ 1 ] != len ( dists ) : msg = "Mismatch in number of parameters and distributions.\n" msg += "Num parameters: {}" . format ( params . shape [ 1 ] ) msg += "Num distributions: {}" . format ( len ( dists ) ) raise ValueError ( msg ) params = _nonuniform_scale_samples ( params , bounds , dists ) problem [ 'sample_scaled' ] = True return params