Version: 2024-01-07
The goal of this code is to provide a structure to the implementation of the ranking algorithms, so they can be immediately applied to any available dataset. It also provides a possibility to gain insights about the games datasets and the way to export the results to reasonable formats.
algos
- specific ranking-algorithm functionsclasses
- general concepts for implementing the algorithmsutils
- various utility functionstests
- scripts validating the implemented algorithms
To initialize the code, do the following:
- Clone the repo using
git clone https://github.com/Berenito/Ranking.git
- Create python env, install packages to it using
pip install requirements.txt
All important constants and definitions are located in the definitions.py
file.
Take data from all the CSV files in the input folder and join them to create a big Game Table with the clean data; export some preliminary summary statistics (no rankings are calculated here).
Prerequisites:
- Prepare a folder with the tournament result data - CSV files named
games_<suffix>.csv
with columnsTournament, Date, Team_1, Team_2, Score_1, Score_2, Division
- Add to the same folder a CSV file with columns
Team
,Aliases
specifying the teams in the EUF system; multiple aliases can be defined for each team in the same row, separated with,
(filename should beteams-<division>.csv
) - Add to the same folder a CSV file with columns
Team
,Tournament
specifying that the given team has met the EUF roster requirements for the particular tournament (filename should beteams_at_tournaments-<division>.csv
)
Arguments:
--input <INPUT>
- path to the folder with all necessary files--season <SEASON>
- current year--output <OUTPUT>
- path to the folder to save the output CSVs[--division <DIVISION>]
- women/mixed/open/all (default "all")
Procedure:
- If division is "all", repeat the next steps for all three divisions
- Read the tournament results CSVs and take only the games for the given division
- Read the list of EUF teams; replace aliases where applicable
- Read teams at tournaments list; remove all the games with any non-EUF team
- Process the Game Table (check for invalid rows)
- Calculate basic statistics for the season (without any rankings)
- Save the output CSVs
Outputs:
- CSVs with Games, Tournaments, Calendar, and Summary (without any rankings)
Calculate the rankings for all defined algorithms.
Prerequisites:
- Run
prepare_data.py
script (use its output path as input to this script) - Specify the algorithms in
definitions.py
Arguments:
--input <INPUT>
- path to the folder with all necessary files--season <SEASON>
- current year--date <DATE>
- date of calculation--output <OUTPUT>
- path to save the output files[--division <DIVISION>]
- women/mixed/open/all (default "all")
Outputs:
- CSV with Games, Summary (including ratings)