Assign freezing teams based on individual performance at the start of the competition and optionally performance at the end of the last competition.
Yes, the quotes are sadly required.
sbt "run --captains data/captains-2021.csv --athletes data/athletes-2021.csv --points data/points-2021-01-07.csv --out assignments.csv"
This will write out assignments.csv
with the team assignments based just on year-to-date performance.
To factor in prior-year points, provide a CSV with the prior points and choose a weighting for the prior year (0.33 to weight prior year 33%, current year 67%). This calculation needs to know how many days of competition the current and prior CSVs represent; by default it assumes 7 days for the current year and uses astrological divination for the prior year. If prior data does not exist for an athlete, just their current year performance is considered.
sbt "run --captains data/captains-2021.csv --points data/points-2021-01-07.csv --prior data/points-2020-03-19.csv --out assignments.csv"
Or, to be pedantic:
sbt "run --captains data/captains-2021.csv --points data/points-2021-01-07.csv --prior data/points-2020-03-19.csv --pointsDays 7 --priorDays 58 --priorWeight 0.5 --out assignments.csv"
The CSVs need headers.
The captains CSV file should just contain the captain ids.
Captain
101
202
303
404
The athletes CSV file should just contain the athlete ids and names (including captains).
Athlete,Name,Email
101,Chris Christofferson,[email protected]
202,Kris Kristey,[email protected]
303,Crystal Maze,[email protected]
404,Krys Kringle,[email protected]
The points CSV file should contain the athlete ids and their points as of some date.
Athlete,Points
101,12.34
109,23.45
181,34.56
829,45.67
Pull this from the database as, for example:
SELECT athlete_id, SUM(points)
FROM daily_scores
WHERE ride_date <= '2021-01-07'
GROUP BY athlete_id
The prior points CSV should look just like the athletes CSV. Don't fill in with zeroes; if an athlete is missing then only their current performance is considered.
The assignments file will contain team id and athlete id.
Team,Strava ID,Name,Email,Captain
1,101,Chris,[email protected],Yes
1,109,Kris,[email protected],
Team ids are somewhat arbitrarily assigned.