Data Processing - livef1.data_processing¶
Data Models¶
Classes
|
Encapsulates a basic result dataset, typically in JSON format. |
- class livef1.data_processing.data_models.BasicResult(data: dict)[source]¶
Encapsulates a basic result dataset, typically in JSON format.
- Parameters:
- data
dict The JSON-like data to be encapsulated within the result.
- data
- Attributes:
- value
dict The data associated with the result, stored as a dictionary (JSON-like structure).
- value
Data Preprocessing¶
Classes
|
A class that handles Extract-Transform-Load (ETL) operations for F1 session data. |
- class livef1.data_processing.etl.livef1SessionETL(session)[source]¶
A class that handles Extract-Transform-Load (ETL) operations for F1 session data.
- Parameters:
- session
Session The session object.
- session
- Attributes:
- session
Session The session object containing session-related information.
- function_map :class:`dict`
A dictionary mapping various session data titles to their corresponding parsing functions.
- session
Methods
aggregate_data(data)Aggregate the cleaned data to produce gold level data.
clean_data(data)Clean the raw data to produce silver level data.
Process raw data to produce bronze level data.
Process silver level data to produce gold level data.
Process bronze level data to produce silver level data.
unified_parse(title, data)Unified parsing function that selects the appropriate parser function based on the title.
- aggregate_data(data)[source]¶
Aggregate the cleaned data to produce gold level data.
- Parameters:
- data
list The cleaned data to be aggregated.
- data
- Returns:
listThe aggregated data.
- clean_data(data)[source]¶
Clean the raw data to produce silver level data.
- Parameters:
- data
list The raw data to be cleaned.
- data
- Returns:
listThe cleaned data.
- process_bronze_level()[source]¶
Process raw data to produce bronze level data.
- Returns:
BronzeResultAn object containing the bronze level data.
- process_gold_level()[source]¶
Process silver level data to produce gold level data.
- Returns:
GoldResultAn object containing the gold level data.
Functions
|
Parses car data (z-axis) for each driver. |
|
Parses current tyre data for each driver. |
|
Parses the driver list data. |
|
Parses driver race info data. |
|
Parses extrapolated clock data. |
|
Parses the heartbeat data. |
|
Parses lap series data for each driver. |
|
Parses driver position (z-axis) data. |
|
Parses race control messages. |
|
Parses session data for each driver. |
|
Parses general session information. |
|
Parses the session status data. |
|
Parses team radio data. |
|
Parses timing data for each driver. |
|
Parses TLA RCM (Track Location Allocation Race Control Messages) data. |
|
Parses the top three drivers' data. |
|
Parses the tyre stint series data, generating records for each stint. |
|
Parses weather data for the session. |
- livef1.data_processing.parse_functions.parse_car_data_z(data, sessionKey, **kwargs)[source]¶
Parses car data (z-axis) for each driver.
- Parameters:
- data
dict The car data.
- sessionKey
int The key of the current session.
- data
- Yields:
- dict
A record containing the session key, timestamp, UTC time, driver number, and channel data.
- livef1.data_processing.parse_functions.parse_current_tyres(data, sessionKey, **kwargs)[source]¶
Parses current tyre data for each driver.
- Parameters:
- data
dict The current tyre data.
- sessionKey
int The key of the current session.
- data
- Yields:
- dict
A record containing the session key, timestamp, driver number, and tyre-related info.
- livef1.data_processing.parse_functions.parse_driver_list(data, sessionKey, **kwargs)[source]¶
Parses the driver list data.
- Parameters:
- data
dict The driver list data.
- sessionKey
int The key of the current session.
- data
- Yields:
- dict
A record containing the session key, driver number, and driver-related info.
- livef1.data_processing.parse_functions.parse_driver_race_info(data, sessionKey, **kwargs)[source]¶
Parses driver race info data.
- Parameters:
- data
dict The driver race info data.
- sessionKey
int The key of the current session.
- data
- Yields:
- dict
A record containing the session key, timestamp, driver number, and other race-related info.
- livef1.data_processing.parse_functions.parse_extrapolated_clock(data, sessionKey, **kwargs)[source]¶
Parses extrapolated clock data.
- Parameters:
- data
dict The extrapolated clock data.
- sessionKey
int The key of the current session.
- data
- Yields:
- dict
A record containing the session key, timestamp, and other clock-related info.
- livef1.data_processing.parse_functions.parse_hearthbeat(data, sessionKey, **kwargs)[source]¶
Parses the heartbeat data.
- Parameters:
- data
dict The heartbeat data.
- sessionKey
int The key of the current session.
- data
- Yields:
- dict
A record containing the session key, timestamp, and UTC time.
- livef1.data_processing.parse_functions.parse_lap_series(data, sessionKey, **kwargs)[source]¶
Parses lap series data for each driver.
- Parameters:
- data
dict The lap series data.
- sessionKey
int The key of the current session.
- data
- Yields:
- dict
A record containing the session key, timestamp, driver number, lap number, and lap position.
- livef1.data_processing.parse_functions.parse_position_z(data, sessionKey, **kwargs)[source]¶
Parses driver position (z-axis) data.
- Parameters:
- data
dict The driver position data.
- sessionKey
int The key of the current session.
- data
- Yields:
- dict
A record containing the session key, timestamp, UTC time, driver number, and z-axis position data.
- livef1.data_processing.parse_functions.parse_race_control_messages(data, sessionKey, **kwargs)[source]¶
Parses race control messages.
- Parameters:
- data
dict The race control messages data.
- sessionKey
int The key of the current session.
- data
- Yields:
- dict
A record containing the session key, timestamp, and message details.
- livef1.data_processing.parse_functions.parse_session_data(data, sessionKey, **kwargs)[source]¶
Parses session data for each driver.
- Parameters:
- data
dict The session data.
- sessionKey
int The key of the current session.
- data
- Yields:
- dict
A record containing the session key and session-related info.
- livef1.data_processing.parse_functions.parse_session_info(data, sessionKey, **kwargs)[source]¶
Parses general session information.
- Parameters:
- data
dict The session information data.
- sessionKey
int The key of the current session.
- data
- Yields:
- dict
A record containing the session key, timestamp, and session-related information.
- livef1.data_processing.parse_functions.parse_session_status(data, sessionKey, **kwargs)[source]¶
Parses the session status data.
- Parameters:
- data
dict The session status data.
- sessionKey
int The key of the current session.
- data
- Yields:
- dict
A record containing the session key, timestamp, and session status.
- livef1.data_processing.parse_functions.parse_team_radio(data, sessionKey, **kwargs)[source]¶
Parses team radio data.
- Parameters:
- data
dict The team radio data.
- sessionKey
int The key of the current session.
- data
- Yields:
- dict
A record containing the session key, timestamp, and captured radio messages.
- livef1.data_processing.parse_functions.parse_timing_data(data, sessionKey, **kwargs)[source]¶
Parses timing data for each driver.
- Parameters:
- data
dict The timing data.
- sessionKey
int The key of the current session.
- data
- Yields:
- dict
A record containing the session key, timestamp, driver number, and various timing metrics.
- livef1.data_processing.parse_functions.parse_tlarcm(data, sessionKey, **kwargs)[source]¶
Parses TLA RCM (Track Location Allocation Race Control Messages) data.
- Parameters:
- data
dict The TLA RCM data.
- sessionKey
int The key of the current session.
- data
- Yields:
- dict
A record containing the session key, timestamp, and the message content.
- livef1.data_processing.parse_functions.parse_top_three(data, sessionKey, **kwargs)[source]¶
Parses the top three drivers’ data.
- Parameters:
- data
dict The top three data.
- sessionKey
int The key of the current session.
- data
- Yields:
- dict
A record containing the session key, timestamp, driver position, and related info.
- livef1.data_processing.parse_functions.parse_tyre_stint_series(data, sessionKey, **kwargs)[source]¶
Parses the tyre stint series data, generating records for each stint.
- Parameters:
- data
dict The tyre stint series data.
- sessionKey
int The key of the current session.
- data
- Yields:
- dict
A record containing the session key, timestamp, driver number, pit count, and other stint-related info.
- livef1.data_processing.parse_functions.parse_weather_data(data, sessionKey, **kwargs)[source]¶
Parses weather data for the session.
- Parameters:
- data
dict The weather data.
- sessionKey
int The key of the current session.
- data
- Yields:
- dict
A record containing the session key, timestamp, and weather-related information.