Medallion Architecture - livef1.data_processing.lake
¶
Data Lakes¶
Classes
|
|
|
|
|
|
|
- class livef1.data_processing.lakes.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
Silver Table Generation Functions¶
Functions
|
|
|
Generates a telemetry table for car data by combining and processing position and car data from the provided BronzeLake object. The function interpolates missing data, aligns it with session laps, and calculates cumulative distance covered during each lap. Args: bronze_lake (BronzeLake): An object containing the raw position and car data, as well as session and circuit information. Returns: pd.DataFrame: A DataFrame containing processed telemetry data for all drivers, including: - DriverNo: Driver number. - Utc: Timestamp in UTC. - lap_number: Lap number for the driver. - Distance: Cumulative distance covered during the lap. - SessionKey: Session identifier. - timestamp: Time elapsed since the session start. - Other interpolated and processed telemetry data. Notes: - The function interpolates missing data based on predefined interpolation methods. - Data is filtered to include only timestamps within the lap start and end times. - Cumulative distance is calculated for each lap using speed and timestamp data, adjusted for the circuit's starting line position and direction. Raises: ValueError: If required data is missing or cannot be processed. |
- livef1.data_processing.silver_functions.add_distance_to_lap(lap_df, start_x, start_y, x_coeff, y_coeff)[source]¶
Calculates the cumulative distance covered by a car during a lap based on its speed and timestamp. Adjusts the distance based on the starting line coordinates and direction.
- Args:
lap_df (pd.DataFrame): DataFrame containing lap data with columns ‘speed’, ‘timestamp’, ‘X’, and ‘Y’. start_x (float): X-coordinate of the starting line. start_y (float): Y-coordinate of the starting line. x_coeff (float): Coefficient for determining direction along the X-axis. y_coeff (float): Coefficient for determining direction along the Y-axis.
- Returns:
pd.DataFrame: Updated DataFrame with a new ‘Distance’ column representing the cumulative distance.
- livef1.data_processing.silver_functions.generate_car_telemetry_table(bronze_lake)[source]¶
Generates a telemetry table for car data by combining and processing position and car data from the provided BronzeLake object. The function interpolates missing data, aligns it with session laps, and calculates cumulative distance covered during each lap. Args:
- bronze_lake (BronzeLake): An object containing the raw position and car data, as well as
session and circuit information.
- Returns:
- pd.DataFrame: A DataFrame containing processed telemetry data for all drivers, including:
DriverNo: Driver number.
Utc: Timestamp in UTC.
lap_number: Lap number for the driver.
Distance: Cumulative distance covered during the lap.
SessionKey: Session identifier.
timestamp: Time elapsed since the session start.
Other interpolated and processed telemetry data.
- Notes:
The function interpolates missing data based on predefined interpolation methods.
Data is filtered to include only timestamps within the lap start and end times.
Cumulative distance is calculated for each lap using speed and timestamp data, adjusted for the circuit’s starting line position and direction.
- Raises:
ValueError: If required data is missing or cannot be processed.