########################################## # Script to run before computing_all.py # Input: xlsx tournaments database # config.yaml # Output: xlsx tournaments database # # It looks for unknown or unrated players. # It will ask for information not given # and saves the result into the same xlsx ########################################## xlsx_file = cfg["io"]["data_folder"] + cfg["io"]["tournaments_filename"] # Listing tournament sheetnames by increasing date tournament_sheetnames = utils.get_sheetnames_by_date(xlsx_file, cfg["sheetname"]["tournaments_key"]) # Loading and completing the players list players = models.PlayersList() players.load_list(utils.load_sheet_workbook(xlsx_file, cfg["sheetname"]["players"])) # Loading initial ranking and adding new players with 0 ranking = utils.load_ranking_sheet(xlsx_file, cfg["sheetname"]["initial_ranking"]) for tid, tournament_sheetname in enumerate(tournament_sheetnames): # Loading tournament info tournament = utils.load_tournament_xlsx(xlsx_file, tournament_sheetname) for name in tournament.get_players_names(): if players.get_pid(name) is None: association = input("Enter the association of %s:\n" % name)
# config.yaml # Output: xlsx rankings database # xlsx log file # # It looks for unknown or unrated players. # It will ask for information not given # and saves the result into the same xlsx ########################################## tournaments_xlsx = cfg["io"]["data_folder"] + cfg["io"]["tournaments_filename"] rankings_xlsx = cfg["io"]["data_folder"] + cfg["io"]["rankings_filename"] log_xlsx = cfg["io"]["data_folder"] + cfg["io"]["log_filename"] histories_xlsx = cfg["io"]["data_folder"] + "histories.xlsx" # Listing tournament sheetnames by increasing date tournament_sheetnames = utils.get_sheetnames_by_date(tournaments_xlsx, cfg["sheetname"]["tournaments_key"]) # Loading players info list players = models.PlayersList() players.load_list(utils.load_sheet_workbook(tournaments_xlsx, cfg["sheetname"]["players"])) # Loading initial ranking initial_ranking = utils.load_ranking_sheet(tournaments_xlsx, cfg["sheetname"]["initial_ranking"]) for tid, tournament_sheetname in enumerate(tournament_sheetnames): # Loading tournament info tournament = utils.load_tournament_xlsx(tournaments_xlsx, tournament_sheetname) old_ranking = models.Ranking("pre_" + tournament.name, tournament.date, tournament.location, tid - 1) # Load previous ranking if exists