Ejemplo n.º 1
0
def test_measure_pipeline():
    def f(x):
        return True

    d = Distribution([0.1, 0.2])

    output = wrappers.measure_pipeline(f, d)

    assert output['arg0'] == True
Ejemplo n.º 2
0
def min(dist, **kwargs):
    """Measures the minimum value of a distribution.

    Args:
        dist (Distribution): Distribution to be analyzed.

    Returns:
        Dictionary holding the measure's outputs.

    """

    logger.info('Finding minimum value ...')

    output = w.measure_pipeline(np.min, dist, **kwargs)

    logger.info('Minimum value found.')
    logger.debug(output)

    return output
Ejemplo n.º 3
0
def median(dist, **kwargs):
    """Measures the median of a distribution.

    Args:
        dist (Distribution): Distribution to be analyzed.

    Returns:
        Dictionary holding the measure's outputs.

    """

    logger.info('Calculating median ...')

    output = w.measure_pipeline(np.median, dist, **kwargs)

    logger.info('Median calculated.')
    logger.debug(output)

    return output
Ejemplo n.º 4
0
def var(dist, **kwargs):
    """Measures the variance of a distribution.

    Args:
        dist (Distribution): Distribution to be analyzed.

    Returns:
        Dictionary holding the measure's outputs.

    """

    logger.info('Calculating variance ...')

    output = w.measure_pipeline(np.var, dist, **kwargs)

    logger.info('Variance calculated.')
    logger.debug(output)

    return output
Ejemplo n.º 5
0
def std(dist, **kwargs):
    """Measures the standard deviation of a distribution.

    Args:
        dist (Distribution): Distribution to be analyzed.

    Returns:
        Dictionary holding the measure's outputs.

    """

    logger.info('Calculating standard deviation ...')

    output = w.measure_pipeline(np.std, dist, **kwargs)

    logger.info('Standard deviation calculated.')
    logger.debug(output)

    return output
Ejemplo n.º 6
0
def skewness(dist, **kwargs):
    """Measures the skewness of a distribution.

    Args:
        dist (Distribution): Distribution to be analyzed.

    Returns:
        Dictionary holding the measure's outputs.

    """

    logger.info('Calculating skewness ...')

    output = w.measure_pipeline(s.skew, dist, **kwargs)

    logger.info('Skewness calculated.')
    logger.debug(output)

    return output
Ejemplo n.º 7
0
def kurtosis(dist, **kwargs):
    """Measures the kurtosis of a distribution.

    Args:
        dist (Distribution): Distribution to be analyzed.

    Returns:
        Dictionary holding the measure's outputs.

    """

    logger.info('Calculating kurtosis ...')

    output = w.measure_pipeline(s.kurtosis, dist, **kwargs)

    logger.info('Kurtosis calculated.')
    logger.debug(output)

    return output
Ejemplo n.º 8
0
def rank(dist, **kwargs):
    """Ranks the values of a distribution.

    Args:
        dist (Distribution): Distribution to be analyzed.

    Returns:
        Dictionary holding the measure's outputs.

    """

    logger.info('Ranking distribution ...')

    output = w.measure_pipeline(s.rankdata, dist, **kwargs)

    logger.info('Distribution ranked.')
    logger.debug(output)

    return output