Beispiel #1
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
Beispiel #2
0
def test_network_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(network(data, "author_name", "files"), Network)
Beispiel #3
0
def test_repo_network_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 = network(data, "author_name", "files")
    display(a, show_plots=False)
    assert True
Beispiel #4
0
def test_network_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)
    a = network(data, "author_name", "files")
    assert len(a.dataframe.index) == 36
Beispiel #5
0
def test_network_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 = network(data, "author_name", "files")
    assert a.dataframe.columns.tolist() == ["centrality"]
Beispiel #6
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
Beispiel #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
Beispiel #8
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
Beispiel #9
0
def test_network_on_issues_row_count():
    data = parse_issues(PATH_TO_RESOURCES + "issues.json")
    a = network(data, "author", "discussion")
    assert len(a.dataframe.index) == 30
Beispiel #10
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.network(data, "sender_name", "references", "message_id")
    cd.display(a, palette=args.palette, output=output_filename)
Beispiel #11
0
def test_network_on_mailinglist_row_count():
    data = parse_mail(PATH_TO_RESOURCES + "mailinglist.mbox")
    a = network(data, "sender_name", "references", "message_id")
    assert len(a.dataframe.index) == 8
Beispiel #12
0
def test_network_on_mailinglist_cols():
    data = parse_mail(PATH_TO_RESOURCES + "mailinglist.mbox")
    a = network(data, "sender_name", "references", "message_id")
    assert a.dataframe.columns.tolist() == ["centrality"]
Beispiel #13
0
def test_network_on_mailinglists_return_type():
    data = parse_mail(PATH_TO_RESOURCES + "mailinglist.mbox")
    assert isinstance(network(data, "sender_name", "references", "message_id"),
                      Network)
Beispiel #14
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_issues(args.paths, start_date, end_date)
    a = cd.network(data, "author", "discussion")
    cd.display(a, palette=args.palette, output=args.output)
Beispiel #15
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
Beispiel #16
0
def test_network_on_issues_cols():
    data = parse_issues(PATH_TO_RESOURCES + "issues.json")
    a = network(data, "author", "discussion")
    assert a.dataframe.columns.tolist() == ["centrality"]
Beispiel #17
0
# limitations under the License.
#

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="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.network(data, "author_name", "files")
    cd.display(a, palette=args.palette, output=args.output)