Skip to content

Commit

Permalink
Added ability to handle IRL code in UCI Dataride input.
Browse files Browse the repository at this point in the history
  • Loading branch information
esitarski committed Mar 21, 2024
1 parent f8ee63e commit 2869136
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 8 deletions.
4 changes: 4 additions & 0 deletions SeriesMgr/FieldMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ def get_name_from_alias( self, alias ):
('Paid','Fee Paid',),
"Paid",
),
('irl',
('IRL',),
"Dataride DNF/DNS/DSQ/LAP/REL status field",
),
('email',
('Email',),
"Email",
Expand Down
9 changes: 9 additions & 0 deletions SeriesMgr/GetModelInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,16 @@ def ExtractRaceResultsExcel( raceInSeries, seriesModel ):
'categoryName': categoryNameSheet if isUCIDataride else f('category_code',None),
'laps': f('laps',1),
'pointsInput': f('points',defaultPointsInput),
'irl': f('irl',None),
}

info['rank'] = str(info['rank']).strip()

# Handle the status in the irl column.
if not info['rank'] and info['irl'] in {'DQ', 'DSQ', 'DNS', 'DNF'}:
info['rank'] = info['irl']
info.pop('irl', None)

if not info['rank']: # If missing rank, assume end of input.
break

Expand All @@ -265,9 +272,11 @@ def ExtractRaceResultsExcel( raceInSeries, seriesModel ):
except ValueError:
pass

# Handle DNF status by assigning special rank.
if info['rank'] == 'DNF':
info['rank'] = SeriesModel.rankDNF

# For all other status, ignore the result.
if not isinstance(info['rank'], int):
continue

Expand Down
2 changes: 1 addition & 1 deletion SeriesMgr/Version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
AppVerName="SeriesMgr 3.0.20-private"
AppVerName="SeriesMgr 3.0.21-private"
34 changes: 27 additions & 7 deletions SeriesMgr/helptxt/QuickStart.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Introduction
Welcome to SeriesMgr!

SeriesMgr makes is easy to combine results from multiple events into an overallseries. Series can be scored by:
SeriesMgr makes is easy to combine results from multiple events into an overall series. Series can be scored by:

* Points for Place (can be different for each event)
* Total Time
Expand All @@ -16,9 +16,17 @@ SeriesMgr reads CrossMgr race files directly. It also reads Excel spreadsheets.

## Rider Identification

SeriesMgr uses __First Name__, __Last Name__ and __License__ to identify riders. The fields __must__ be specified in the CrossMgr or Spreadsheet input. Upper/lower case does not matter.
SeriesMgr can match riders by First, Last name, license code or UCI ID.

The __First Name__, __Last Name__ and __License__ (ignoring case) all must match *exactly* for a result to be considered from the same rider. For example, "James Smith", "Jim Smith", "Jimmy Smith" and "J. Smith" will all be treated as different riders.
### Matching by First and Last name

On the __Properties__ page, set __Input Options__ to "Use First and Last Names to identify riders".

SeriesMgr uses __First Name__ and __Last Name__.

These fields __must__ be headers on the first row of the CrossMgr or Spreadsheet input. Upper/lower case does not matter.

To be considered a match, the __First Name__, __Last Name__ (ignoring case) all must match *exactly* for a result to be considered from the same rider. For example, "James Smith", "Jim Smith", "Jimmy Smith" and "J. Smith" will all be treated as different riders.

If you don't have a __License__ and want to use name only, you must still have a __License__ column in the input, but the values can be blank.

Expand All @@ -28,6 +36,16 @@ Of course, you can still differentiate the names (for example, change one "Jim S

SeriesMgr also supports __aliaes__ for names, teams and licenses. Aliases allow you to map common misspellings/alternate spellings to a standard name.

### Matching by License Code

On the __Properties__ page, set __Input Options__ to "Use License to identify riders".
There must be a "License" header.

### Matching by UCI ID

On the __Properties__ page, set __Input Options__ to "Use UCI ID to identify riders".
There must be a __UCI ID__ column.

## Category Identification

For CrossMgr races, the rider's category comes from the CrossMgr Categories screen based on the bib number ranges. To control which Categories are considered in SeriesMgr, set the flag in the CrossMgr Categories screen. For example, if you have a Beginner category you don't want to consider in a Series (or a Custom category, etc), make sure to uncheck the Series flag.
Expand All @@ -41,7 +59,7 @@ CrossMgr categories always contain the category gender in brackets on the end (f

## Team Identification

SeriesMgr computes Team results, but you don't have to use them.
SeriesMgr computes Team results (but you don't have to use them).

If you are interested in Team results, the Team names must be present in the Race files. Sometimes there is considerable variation in the same Team name (for example, "Beaches Cycling Club", "Beaches Cycling", "BCC"). You can map variations to a single name in the Team Alias screen.

Expand Down Expand Up @@ -77,21 +95,23 @@ It is a good practice to open each CrossMgr race beforehand to ensure that its E

## Excel Races

SeriesMgr supports race results in Excel (either .xls or .xlsx). SeriesMgr will read Excel sheets in USAC upload format.
SeriesMgr supports race results in Excel (either .xls or .xlsx). SeriesMgr will also read Excel sheets in USAC upload format as well as UCI Dataride format.

1. Starting form the top of the sheet, SeriesMgr looks for a cell in the first column that is one of 'Pos','Pos.','Rank', 'Rider Place' or 'Place'. This is the __Header Row__. Rows about the __Header Row__ are ignored.
1. The __Header Row__ can contain other header values as described in the table below. Unrecognized headers are ignored. Upper/lower case does not matter.
1. Except for the __Pos__ column (or one of its equivalents) which must be in the first column, headers can be in any order.
1. Appropriate data are expected in the columns under each header. Other data not under a header is ignored.
1. If the __Category__ column is not present, the rider's category is taken from the Excel sheet name. This allows the Excel sheet to be organized with each Category name in each sheet. Alternatively, if the __Category__ column is present, multiple categories can be submitted all in one sheet.
1. For UCI Dataride format, the Category is taken from the name of the folder the Excel file is in.

| Header | Status | Description
|---------------|:-------------|:-------------
| 'Pos','Pos.','Rank', 'Rider Place' or 'Place' | Required | Finish position of the rider starting from 1. May also contain DNF, DQ, DNS, PUL.
| 'LastName','Last Name','LName','Rider Last Name'| Required | Rider's last name
| 'FirstName','First Name','FName','Rider First Name'| Required | Rider's first name
| 'Licence','Licence #','Rider License #'| Required | Rider's license number
| 'Race Category','RaceCategory','Race_Category' | Optional | Rider Category. If not present, the Category will be taken from the Excel Sheet name.
| 'Licence','Licence #','Rider License #'| Optional | Rider's license number
| 'UCI ID','UCIID','UCI_ID'| Optional | Rider's UCI ID
| 'Race Category','RaceCategory','Race_Category' | Optional | Rider Category. If not present, the Category will be taken from the Excel Sheet name (1). If a UCI Dataride file, the Category will be name of the folder the file is in.
| 'Team','Team Name','TeamName','Rider Team','Club','Club Name','ClubName','Rider Club','Rider Club/Team' | Optional | Rider's team name.
| 'Time','Tm.','Rider Time' | Finish Time

Expand Down

0 comments on commit 2869136

Please sign in to comment.