Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
F1 Overtake Analyser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lennard Geese
F1 Overtake Analyser
Commits
25ed4113
Commit
25ed4113
authored
3 weeks ago
by
Lennard Geese
Browse files
Options
Downloads
Patches
Plain Diff
Remove deprecated functions
parent
231b54c6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
DataAnalyser.py
+6
-54
6 additions, 54 deletions
DataAnalyser.py
with
6 additions
and
54 deletions
DataAnalyser.py
+
6
−
54
View file @
25ed4113
...
@@ -110,60 +110,6 @@ class DataAnalyser(DataHandler):
...
@@ -110,60 +110,6 @@ class DataAnalyser(DataHandler):
def
getGridPositions
(
self
,
race
:
Session
):
sessionResults
=
race
.
results
gridPositions
:
dict
[
str
,
int
]
=
{}
# driverId & lapNumber
for
i
in
range
(
self
.
numberOfDrivers
):
driverPosition
=
sessionResults
[
'
GridPosition
'
].
iloc
[
i
]
driverAbbreviation
=
sessionResults
[
'
Abbreviation
'
].
iloc
[
i
]
gridPositions
[
driverAbbreviation
]
=
driverPosition
if
self
.
activateDebugOvertakeAnalysis
:
print
(
f
"
\n
Lap: 0
"
)
for
i
in
range
(
len
(
gridPositions
)):
position
:
int
=
i
+
1
gridPositions
.
values
()
driverAtPosition
=
self
.
getDriverByPositionFromMap
(
gridPositions
,
position
)
print
(
f
"
P
{
position
}
:
{
driverAtPosition
}
"
)
return
gridPositions
def
getRunningLapsPositions
(
self
,
race
:
Session
):
runningLapsPositions
:
list
[
dict
[
str
,
int
]]
=
[]
allRaceLaps
=
race
.
laps
for
raceLapIndex
in
range
(
race
.
total_laps
):
runningLapPositions
:
dict
[
str
,
int
]
=
{}
# driverId & lapNumber
for
driver
in
race
.
drivers
:
raceLap
=
allRaceLaps
.
pick_laps
(
raceLapIndex
+
1
)
# Lap 0 doesn't exist
raceLap
=
raceLap
.
pick_drivers
(
driver
)
try
:
driverAbbreviation
=
raceLap
[
'
Driver
'
].
iloc
[
0
]
driverPosition
=
raceLap
[
'
Position
'
].
iloc
[
0
]
runningLapPositions
[
driverAbbreviation
]
=
driverPosition
except
:
# triggered when not all drivers that took part reached lap end (i.e. when value is NaN), probably by crashing or being behind
x
=
0
# do nothing
runningLapsPositions
.
append
(
runningLapPositions
)
# debug
if
self
.
activateDebugOvertakeAnalysis
:
for
raceLapIndex
in
range
(
race
.
total_laps
):
print
(
f
"
\n
Lap:
{
raceLapIndex
+
1
}
"
)
runningLapPositions
=
runningLapsPositions
[
raceLapIndex
]
for
i
in
range
(
len
(
runningLapPositions
)):
runningLapPositions
.
values
()
position
:
int
=
i
+
1
driverAtPosition
=
self
.
getDriverByPositionFromMap
(
runningLapPositions
,
position
)
print
(
f
"
P
{
position
}
:
{
driverAtPosition
}
"
)
return
runningLapsPositions
def
getDriverByPositionFromMap
(
self
,
positions
:
dict
[
str
,
int
],
position
:
int
):
driver
=
list
(
positions
.
keys
())[
list
(
positions
.
values
()).
index
(
position
)]
return
driver
# ===== Weather =====
# ===== Weather =====
def
analyseRacesForWeather
(
self
,
races
:
list
[
Session
]):
def
analyseRacesForWeather
(
self
,
races
:
list
[
Session
]):
...
@@ -177,6 +123,8 @@ class DataAnalyser(DataHandler):
...
@@ -177,6 +123,8 @@ class DataAnalyser(DataHandler):
x
=
0
x
=
0
return
0
return
0
# ===== Tire Changes =====
# ===== Tire Changes =====
def
getEarliestTireChanges
(
self
,
races
:
list
[
Session
]):
def
getEarliestTireChanges
(
self
,
races
:
list
[
Session
]):
...
@@ -272,11 +220,15 @@ class DataAnalyser(DataHandler):
...
@@ -272,11 +220,15 @@ class DataAnalyser(DataHandler):
if
startingCompound
==
'
SLICK
'
:
return
self
.
slickCompounds
if
startingCompound
==
'
SLICK
'
:
return
self
.
slickCompounds
return
startingCompound
return
startingCompound
# ===== Crashes =====
# ===== Crashes =====
def
analyseRacesForCrashes
(
self
,
races
):
def
analyseRacesForCrashes
(
self
,
races
):
x
=
0
x
=
0
# ===== Events =====
# ===== Events =====
def
analyseRacesForSafetyCars
(
self
,
races
):
def
analyseRacesForSafetyCars
(
self
,
races
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment