Пример #1
0
def test_teamsize_on_issues_display():
    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")
    display(a, show_plots=False)
    assert True
Пример #2
0
def test_repo_activity_display():
    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 = activity(data, "id", "author_name", "date")
    display(a, show_plots=False)
    assert True
Пример #3
0
def test_centrality_display_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"
    )
    display([a, b], show_plots=False)
    assert True
Пример #4
0
def test_network_display_multiple_dfs():
    repo = parse_repositories(PATH_TO_RESOURCES + "repo")
    repo_a = network(repo, "author_name", "files")
    mail = parse_mail(PATH_TO_RESOURCES + "mailinglist.mbox")
    mail_a = network(mail, "sender_name", "references", "message_id")
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    issues_a = network(issues, "author", "discussion")
    display([repo_a, mail_a, issues_a], show_plots=False)
    assert True
Пример #5
0
def test_display_multiple_types():
    data = parse_issues(PATH_TO_RESOURCES + "issues.json")
    a = centrality(data, "id", "author", "created_at", "discussion", name="mixih")
    data = parse_issues(PATH_TO_RESOURCES + "issues.json")
    b = response(data, "id", "author", "created_at", "discussion")
    data = parse_repositories(PATH_TO_RESOURCES + "repo")
    c = network(data, "author_name", "files")
    display([a, b, c], show_plots=False)
    assert True
Пример #6
0
def test_activity_display_multiple_dfs():
    repo = parse_repositories(PATH_TO_RESOURCES + "repo")
    mail = parse_mail(PATH_TO_RESOURCES + "mailinglist.mbox")
    issues = parse_issues(PATH_TO_RESOURCES + "issues.json")
    comm = parse_comments(issues)
    repo_a = activity(repo, "id", "author_name", "date")
    mail_a = activity(mail, "message_id", "sender_name", "date")
    issues_a = activity(issues.merge(comm, how="outer"), "id", "author", "created_at")
    display([repo_a, mail_a, issues_a], show_plots=False)
    assert True
Пример #7
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
Пример #8
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="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

    data = cd.parse_repositories(args.paths, start_date, end_date)
    a = cd.activity(data, "id", "author_name", "date")
    cd.display(a, palette=args.palette, output=args.output)
Пример #9
0
    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(
        "-n",
        "--name",
        help="Name of the contributor to explore," + " if no name is provided a list of names will be proposed",
    )
    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)
    c = cd.centrality(data, "message_id", "sender_name", "date", "references", "message_id", name=args.name)
    if args.name:
        cd.display(c, palette=args.palette, output=output_filename)
    else:
        print("Found authors: ", c)
Пример #10
0
def test_response_display_multiple_dfs():
    data = parse_issues(PATH_TO_RESOURCES + "issues.json")
    a = response(data, "id", "author", "created_at", "discussion")
    b = response(parse_issues(PATH_TO_RESOURCES + "issues2.json"), "id", "author", "created_at", "discussion")
    display([a, b], show_plots=False)
    assert True
Пример #11
0
def test_issues_network_display():
    data = parse_issues(PATH_TO_RESOURCES + "issues.json")
    a = network(data, "author", "discussion")
    display(a, show_plots=False)
    assert True
Пример #12
0
def test_mailinglit_network_display():
    data = parse_mail(PATH_TO_RESOURCES + "mailinglist.mbox")
    a = network(data, "sender_name", "references", "message_id")
    display(a, show_plots=False)
    assert True
Пример #13
0
def test_mailinglit_activity_display():
    data = parse_mail(PATH_TO_RESOURCES + "mailinglist.mbox")
    a = activity(data, "message_id", "sender_name", "date")
    display(a, show_plots=False)
    assert True
Пример #14
0
def test_centrality_issues():
    b = centrality(
        parse_issues(PATH_TO_RESOURCES + "issues2.json"), "id", "author", "created_at", "discussion", name="asu"
    )
    display(b, show_plots=False)
    assert True