Exemple #1
0
def test_teamsize_on_issues_display_multiple_df():
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    comm = parse_comments(issues)
    data = issues.merge(comm, how="outer")
    a = teamsize(data, "id", "author", "created_at")
    b = teamsize(parse_issues(PATH_TO_RESOURCES + "issues2.json"), "id", "author", "created_at")
    display([a, b], show_plots=False)
    assert True
Exemple #2
0
def test_teamsize_on_repository_row_count():
    repo = PATH_TO_RESOURCES + "repo"
    if not os.listdir(repo):
        raise Exception("Empty git submodule. Try: git submodule update --init")
    data = parse_repositories(repo, end_date="2019-08-12")
    a = teamsize(data, "id", "author_name", "date")
    assert len(a.dataframe.index) == 73
Exemple #3
0
def test_teamsize_on_issues_with_reporters_cols():
    data = parse_issues(PATH_TO_RESOURCES + "issues.json")
    a = teamsize(data, "id", "author", "created_at")
    assert a.dataframe.columns.tolist() == [
        "date",
        "entry_count",
        "author_count",
        "entry_count_lowess",
        "author_count_lowess",
    ]
Exemple #4
0
def test_teamsize_on_mailinglist_cols():
    data = parse_mail(PATH_TO_RESOURCES + "mailinglist.mbox")
    a = teamsize(data, "message_id", "sender_name", "date")
    assert a.dataframe.columns.tolist() == [
        "date",
        "entry_count",
        "author_count",
        "entry_count_lowess",
        "author_count_lowess",
    ]
Exemple #5
0
def test_teamsize_on_repository_cols():
    repo = PATH_TO_RESOURCES + "repo"
    if not os.listdir(repo):
        raise Exception("Empty git submodule. Try: git submodule update --init")
    data = parse_repositories(repo)
    a = teamsize(data, "id", "author_name", "date")
    assert a.dataframe.columns.tolist() == [
        "date",
        "entry_count",
        "author_count",
        "entry_count_lowess",
        "author_count_lowess",
    ]
Exemple #6
0
def test_display_multiple_types_with_multiple_dfs():
    data = parse_issues(PATH_TO_RESOURCES + "issues.json")
    a = centrality(data, "id", "author", "created_at", "discussion", name="mixih")
    b = centrality(
        parse_issues(PATH_TO_RESOURCES + "issues2.json"), "id", "author", "created_at", "discussion", name="asu"
    )
    path = PATH_TO_RESOURCES + "repo"
    if not os.listdir(path):
        raise Exception("Empty git submodule. Try: git submodule update --init")
    repo = parse_repositories(path)
    c = network(repo, "author_name", "files")
    mail = parse_mail(PATH_TO_RESOURCES + "mailinglist.mbox")
    d = network(mail, "sender_name", "references", "message_id")
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    e = network(issues, "author", "discussion")
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    comm = parse_comments(issues)
    data = issues.merge(comm, how="outer")
    f = teamsize(data, "id", "author", "created_at")
    g = teamsize(parse_issues(PATH_TO_RESOURCES + "issues2.json"), "id", "author", "created_at")
    display([a, b, c, d, e, f, g], show_plots=False)
    assert True
Exemple #7
0
def test_teamsize_on_issue_comments_row_count():
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    data = parse_comments(issues)
    a = teamsize(data, "id", "author", "created_at")
    assert len(a.dataframe.index) == 71
Exemple #8
0
def test_teamsize_return_type():
    repo = PATH_TO_RESOURCES + "repo"
    if not os.listdir(repo):
        raise Exception("Empty git submodule. Try: git submodule update --init")
    data = parse_repositories(repo)
    assert isinstance(teamsize(data, "id", "author_name", "date"), TeamSize)
Exemple #9
0
def test_teamsize_on_mailinglist_row_count():
    data = parse_mail(PATH_TO_RESOURCES + "mailinglist.mbox")
    a = teamsize(data, "message_id", "sender_name", "date")
    assert len(a.dataframe.index) == 6
Exemple #10
0
def test_teamsize_on_mailinglists_return_type():
    data = parse_mail(PATH_TO_RESOURCES + "mailinglist.mbox")
    assert isinstance(teamsize(data, "message_id", "sender_name", "date"), TeamSize)
Exemple #11
0
def test_teamsize_frac():
    data = parse_issues(PATH_TO_RESOURCES + "issues.json")
    large_frac = teamsize(data, "id", "author", "created_at", frac=0.8)
    low_frac = teamsize(data, "id", "author", "created_at", frac=0.025)
    assert not large_frac.dataframe.equals(low_frac.dataframe)
Exemple #12
0
def test_teamsize_on_issues_with_commenters_and_reporters():
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    comments = parse_comments(issues)
    data = issues.merge(comments, how="outer")
    a = teamsize(data, "id", "author", "created_at")
    assert len(a.dataframe.index) == 79
Exemple #13
0
def test_teamsize_on_issues_with_commenters_vs_reporters():
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    comments = parse_comments(issues)
    comm = teamsize(comments, "id", "author", "created_at")
    rep = teamsize(issues, "id", "author", "created_at")
    assert not comm.dataframe.equals(rep.dataframe)
Exemple #14
0
from argparse import ArgumentParser
import comdaan as cd

if __name__ == "__main__":
    # Fetching arguments from command line
    arg_parser = ArgumentParser(description="A tool for visualizing, week by week, who contributes code")
    arg_parser.add_argument(
        "paths",
        metavar="path",
        nargs="+",
        help="Path of a git repository to process or of a directory containing git repositories",
    )
    arg_parser.add_argument("-f", "--start", help="Start date")
    arg_parser.add_argument("-u", "--end", help="End date")
    arg_parser.add_argument(
        "--palette", choices=["blue4", "magma256"], default="magma", help="Choose a palette (default is magma256)"
    )
    arg_parser.add_argument("-t", "--title", help="Title")
    arg_parser.add_argument("-o", "--output", help="Output file (default is 'result.html')")
    args = arg_parser.parse_args()

    start_date = args.start
    end_date = args.end
    output_filename = args.output or "result.html"

    issues = cd.parse_issues(args.paths, start_date, end_date)
    comments = cd.parse_comments(issues)
    data = issues.merge(comments, how="outer")
    a = cd.teamsize(data, "id", "author", "created_at")
    cd.display(a, palette=args.palette, output=output_filename)
Exemple #15
0
    # Fetching arguments from command line
    arg_parser = ArgumentParser(
        description="A tool for visualizing, week by week, who contributes code"
    )
    arg_parser.add_argument(
        "paths",
        metavar="path",
        nargs="+",
        help=
        "Path of a git repository to process or of a directory containing git repositories",
    )
    arg_parser.add_argument("-f", "--start", help="Start date")
    arg_parser.add_argument("-u", "--end", help="End date")
    arg_parser.add_argument("--palette",
                            choices=["blue4", "magma256"],
                            default="magma",
                            help="Choose a palette (default is magma256)")
    arg_parser.add_argument("-t", "--title", help="Title")
    arg_parser.add_argument("-o",
                            "--output",
                            help="Output file (default is 'result.html')")
    args = arg_parser.parse_args()

    start_date = args.start
    end_date = args.end
    output_filename = args.output or "result.html"

    data = cd.parse_mail(args.paths, start_date, end_date)
    a = cd.teamsize(data, "message_id", "sender_name", "date")
    cd.display(a, palette=args.palette, output=output_filename)
Exemple #16
0
    arg_parser = ArgumentParser(
        description="A tool for visualizing, week by week, who contributes code"
    )
    arg_parser.add_argument(
        "paths",
        metavar="path",
        nargs="+",
        help=
        "Path of a git repository to process or of a directory containing git repositories",
    )
    arg_parser.add_argument("-f", "--start", help="Start date")
    arg_parser.add_argument("-u", "--end", help="End date")
    arg_parser.add_argument("--palette",
                            choices=["blue4", "magma256"],
                            default="magma256",
                            help="Choose a palette (default is magma256)")
    arg_parser.add_argument("-t", "--title", help="Title")
    arg_parser.add_argument("-o",
                            "--output",
                            default="result.html",
                            help="Output file (default is 'result.html')")
    args = arg_parser.parse_args()

    start_date = args.start
    end_date = args.end
    output_filename = args.output or "result.html"

    data = cd.parse_repositories(args.paths, start_date, end_date)
    a = cd.teamsize(data, "id", "author_name", "date", frac=0.4)
    cd.display(a, palette=args.palette, output=output_filename)