Parametrize the DriverRank.jl script
This patch makes the `DriverRank.jl` accept two arguments. The first
is the CSV file to read the input data from. The second is the CSV
file to save the parsed results to.
This patch also updates the Go code parsing the output CSV because it
contains a "header". I.e. labels for the columns.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: Iaeeb02316bc04fbf27962f0f8d9ac12880a61b8d
diff --git a/scouting/webserver/driver_ranking/driver_ranking.go b/scouting/webserver/driver_ranking/driver_ranking.go
index 005078f..82e34e1 100644
--- a/scouting/webserver/driver_ranking/driver_ranking.go
+++ b/scouting/webserver/driver_ranking/driver_ranking.go
@@ -119,7 +119,8 @@
// database.
outputRecords, err := readFromCsv(outputCsvFile)
- for _, record := range outputRecords {
+ // Skip the first row since those are the column labels.
+ for _, record := range outputRecords[1:] {
score, err := strconv.ParseFloat(record[1], 32)
if err != nil {
log.Println("Failed to parse score for team ", record[0], ": ", record[1], ": ", err)