Scottish-Hill-Runners / results

Scottish Hill Runners
4 stars 4 forks source link

Category positions #1

Closed jham005 closed 1 year ago

jham005 commented 1 year ago

Currently, each result row has a RunnerPosition that gives the absolute finishing position. Sorting on this column gives a quick way to list the (male) race winner each year. However, this does not work if the user is interested in the female or vet category winners.

Instead, a set of CategoryPositions could be computed for each row, and the data table will display the most appropriate CategoryPosition that matches the current category filter. So, if the data table is filtered on F40, then only rows with a CategoryPosition that includes F40 would be displayed. Sorting on this column will show the F40 winners for each year.

Vet categories need to overlap, so e.g. if the overall race winner is M50 then the CategoryPositions would be {M50: 1, M40: 1, M: 1}. Youth categories need to overlap upwards, so e.g. a M16 runner is also M18 and M23.

The set of available age categories is determined per race. Races with no M16 results would not display this as a filter option, and would not have CategoryPositions calculated for it.

Male, Female and non-binary gender categories should be derived from the results. So, a result for, e.g., RunnerCategory N40 would be distinct from M40 and F40. Some RunnerCategory normalisation may need to be performed. For example, the V in FV40 is redundant, and should be normalised as F40. Similarly, MU23 is just M23.

jham005 commented 1 year ago

Some basic category position functionality has been added. Yet to do is link this with filtering, and handle dead-heats.