Exemplo n.º 1
0
def empirical_distribution(contest):
    df = ccd.summary(contest)
    n = df.shape[0]
    dist = np.zeros((n, 3))  # [unfunny, somewhat funny, funny]
    for i in range(n):
        dist[i] = get_single_dist(df.iloc[i])
    # tmp = np.zeros((100,3))
    # tmp[:50] = dist[:50]
    # tmp[50:] = dist[-50:]
    return dist
Exemplo n.º 2
0
def test_same_dataframe(filename: str):
    if "590" in filename:
        pytest.xfail("TODO")

    fname = filename.split("/")[-1]
    df1 = ccd.summary(fname)
    df2 = prd.process(str(raw_dashboards / fname))
    assert (df1.columns == df2.columns).all()
    for col in df1.columns:
        if "float" in df1[col].dtype.name:
            assert np.allclose(df1[col], df2[col])
        else:
            assert (df1[col] == df2[col]).all()
Exemplo n.º 3
0
def test_all_summaries(contest):
    start = time()
    df = ccd.summary(contest)
    print("{:0.1f}ms".format(1000 * (time() - start)))
    assert isinstance(df, pd.DataFrame)
Exemplo n.º 4
0
def df(request):
    filename = str(request.param)
    fname = filename.split("/")[-1]
    return ccd.summary(fname)
Exemplo n.º 5
0
def get_means(contest):
    means = ccd.summary(contest)['score'].to_numpy()
    # tmp = np.zeros(100)
    # tmp[:50] = means[:50]
    # tmp[50:] = means[-50:]
    return means