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
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)
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
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
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"]
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
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
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
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
# 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)
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
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"]
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)
# 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)
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
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"]
# 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)