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
7ea87beb
Commit
7ea87beb
authored
1 month ago
by
Lennard Geese
Browse files
Options
Downloads
Patches
Plain Diff
Fix error with html-find() returning None
parent
56643540
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
DataAnalyser.py
+4
-2
4 additions, 2 deletions
DataAnalyser.py
DataImporter.py
+1
-0
1 addition, 0 deletions
DataImporter.py
main.py
+9
-8
9 additions, 8 deletions
main.py
with
14 additions
and
10 deletions
DataAnalyser.py
+
4
−
2
View file @
7ea87beb
...
@@ -131,8 +131,10 @@ class DataAnalyser(DataHandler):
...
@@ -131,8 +131,10 @@ class DataAnalyser(DataHandler):
header
=
tableRow
.
find
(
"
th
"
)
header
=
tableRow
.
find
(
"
th
"
)
if
header
is
None
:
continue
if
header
is
None
:
continue
if
header
.
string
==
"
Weather
"
:
if
header
.
string
==
"
Weather
"
:
weatherRaw
=
tableRow
.
find
(
"
td
"
).
string
weatherEntry
=
tableRow
.
find
(
"
td
"
)
return
re
.
sub
(
"
\n
"
,
""
,
tableRow
.
find
(
"
td
"
).
string
)
weatherString
=
tableRow
.
find
(
"
td
"
).
string
if
weatherString
is
None
:
weatherString
=
weatherEntry
.
contents
[
0
].
string
# needed if entry contains more tags
return
re
.
sub
(
"
\n
"
,
""
,
weatherString
)
raise
KeyError
(
"
No weather entry found
"
)
raise
KeyError
(
"
No weather entry found
"
)
...
...
This diff is collapsed.
Click to expand it.
DataImporter.py
+
1
−
0
View file @
7ea87beb
...
@@ -35,6 +35,7 @@ class DataImporter(DataHandler, ABC):
...
@@ -35,6 +35,7 @@ class DataImporter(DataHandler, ABC):
weatherEntries
:
list
[
string
]
=
[]
weatherEntries
:
list
[
string
]
=
[]
for
e
in
event
:
for
e
in
event
:
weatherEntries
.
append
(
self
.
fetchWeather
(
e
))
weatherEntries
.
append
(
self
.
fetchWeather
(
e
))
return
weatherEntries
# Convert from SessionIdentifier to Event if needed
# Convert from SessionIdentifier to Event if needed
if
isinstance
(
event
,
SessionIdentifier
):
if
isinstance
(
event
,
SessionIdentifier
):
...
...
This diff is collapsed.
Click to expand it.
main.py
+
9
−
8
View file @
7ea87beb
...
@@ -17,6 +17,13 @@ class Main:
...
@@ -17,6 +17,13 @@ class Main:
plotter
=
DataPlotter
()
plotter
=
DataPlotter
()
checker
=
DataChecker
()
checker
=
DataChecker
()
racesToAnalyse
=
[
SessionIdentifier
(
2022
,
"
Imola
"
,
"
R
"
),
# Imola 2022 (DWR)
SessionIdentifier
(
2024
,
"
Imola
"
,
"
R
"
),
# Imola 2024 (SWR)
SessionIdentifier
(
2024
,
"
Montreal
"
,
"
R
"
),
# Canada 2024 (DWR)
SessionIdentifier
(
2023
,
"
Montreal
"
,
"
R
"
)
# Canada 2023 (SWR)
]
def
main
(
self
):
def
main
(
self
):
#dataHandler = Main.DataHandlingPackage()
#dataHandler = Main.DataHandlingPackage()
...
@@ -26,21 +33,15 @@ class Main:
...
@@ -26,21 +33,15 @@ class Main:
#self.printRainRaces()
#self.printRainRaces()
racesToAnalyse
=
[
SessionIdentifier
(
2022
,
"
Imola
"
,
"
R
"
),
# Imola 2022 (DWR)
SessionIdentifier
(
2024
,
"
Imola
"
,
"
R
"
),
# Imola 2024 (SWR)
SessionIdentifier
(
2024
,
"
Montreal
"
,
"
R
"
),
# Canada 2024 (DWR)
SessionIdentifier
(
2023
,
"
Montreal
"
,
"
R
"
)
# Canada 2023 (SWR)
]
#self.overtakeAnalysis(racesToAnalyse)
#self.overtakeAnalysis(racesToAnalyse)
def
testNewRainRaceFetching
(
self
):
def
testNewRainRaceFetching
(
self
):
dataHandler
:
Main
.
DataHandlingPackage
=
Main
.
DataHandlingPackage
()
dataHandler
:
Main
.
DataHandlingPackage
=
Main
.
DataHandlingPackage
()
sessionIdentifier
:
SessionIdentifier
=
SessionIdentifier
(
2024
,
"
Brazil
"
,
"
R
"
)
weather
=
dataHandler
.
importer
.
fetchWeather
(
self
.
racesToAnalyse
)
weather
=
dataHandler
.
importer
.
fetchWeather
(
sessionIdentifier
)
print
(
weather
)
print
(
weather
)
def
printRainRaces
(
self
):
def
printRainRaces
(
self
):
dataHandler
:
Main
.
DataHandlingPackage
=
Main
.
DataHandlingPackage
()
dataHandler
:
Main
.
DataHandlingPackage
=
Main
.
DataHandlingPackage
()
year
:
int
=
2015
year
:
int
=
2015
...
...
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