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_response_on_issues_cols_response_time(): data = parse_issues(PATH_TO_RESOURCES + "issues.json") a = response(data, "id", "author", "created_at", "discussion") assert a.response_time.columns.tolist() == [ "date", "response_time", "response_time_lowess", "response_time_formatted", ]
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
def test_response_on_issues_return_type(): data = parse_issues(PATH_TO_RESOURCES + "issues.json") a = response(data, "id", "author", "created_at", "discussion") assert isinstance(a, Response)
def test_response_on_issues_row_count_response_time(): data = parse_issues(PATH_TO_RESOURCES + "issues.json") a = response(data, "id", "author", "created_at", "discussion") assert len(a.response_time.index) == 135
def test_response_on_issues_cols_unanswered(): data = parse_issues(PATH_TO_RESOURCES + "issues.json") a = response(data, "id", "author", "created_at", "discussion") assert a.unanswered_issues.columns.tolist() == [ "date", "unanswered_to_this_date" ]
# 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" data = cd.parse_issues(args.path, start_date, end_date) a = cd.response(data, "id", "author", "created_at", "discussion") cd.display(a, palette=args.palette, output=output_filename)