Monaco 2018 Formula 1 Qualification Report
Project description
Monaco 2018 Formula 1 Qualification Report
Description
This project provides a report on the Formula 1 qualification for the Monaco 2018 stage. The program allows analyzing the best lap times of drivers, sorting the results, and filtering data by a specific driver.
Requirements
The project requires Python version 3.12 or higher, and the following dependencies:
pytest>=8.3.2coverage>=7.6.1parameterized>=0.9.0
Installation
To install the project, use the following command:
pip install task_6_syrkin
Usage
Once the package is installed, you can run the qualifying report generator from the command line:
monaco-report --files ./data --desc
Command-line options:
--files <path>: Path to the folder containing the log files (start.log, end.log, and abbreviations.txt).--asc: Sort lap times in ascending order (default).--desc: Sort lap times in descending order.--driver <name>: Filter the results to show the lap time and team information for a specific driver by name.
Example
monaco-report --files ./data --asc --driver "Lewis Hamilton"
This command will parse the log files in the ./data folder, sort drivers by lap time in ascending order, and display the results for "Lewis Hamilton".
Log File Format
The log files are expected to follow these formats:
-
start.log: Contains driver abbreviations and their start times.
HAM2019-09-29_13:01:00.123 VER2019-09-29_13:02:00.456
-
end.log: Contains driver abbreviations and their end times.
HAM2019-09-29_13:03:30.789 VER2019-09-29_13:03:32.123
-
abbreviations.txt: Contains driver abbreviations, full names, and teams, separated by underscores.
HAM_Lewis Hamilton_Mercedes VER_Max Verstappen_Red Bull Racing
Code Structure
The main modules of the project include:
file_parser.py: Responsible for reading and parsing the log files.report_builder.py: Contains the logic for calculating lap times, sorting drivers, and building reports.record.py: Defines the Record class, which stores driver data and calculates lap times.report.py: The main entry point for the command-line interface (CLI) that ties together the various components and generates the report.
Testing
Unit tests have been implemented to ensure the correctness of the main functions. You can run the tests using the unittest framework. The tests are located in the tests/ directory.
To run the tests, execute the following command:
python -m unittest discover -s tests
Test Coverage:
file_parser.py: Tests for parsing log files, handling missing data, and incorrect formats.report_builder.py: Tests for calculating lap times, sorting drivers, and generating the report.record.py: Tests for the Record class and the lap time calculation.
Example Output
Here is an example of the output generated by the program: ``` Top-15 drivers:
- Lewis Hamilton | Mercedes | 01:30.456 sec
- Max Verstappen | Red Bull Racing | 01:31.234 sec
Eliminated drivers: 16. Charles Leclerc | Ferrari | 01:32.567 sec ```
Error Handling
The program is designed to handle missing or incorrect data in the following ways:
- If a driver’s start or end time is missing, that driver will be excluded from the final report.
- Errors are logged and can be displayed to the user for debugging or correction.
Known Issues and Limitations
- The log files must be in the correct format. Any deviations from the expected format will cause the program to skip entries or fail to parse them.
- The program assumes that the log files are complete and accurate for the calculation of lap times.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file task_6_syrkin-0.0.4.tar.gz.
File metadata
- Download URL: task_6_syrkin-0.0.4.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d99cd062994a677c41269466e2cadbe911277ca5d69e0df9a50325bd6294a9d
|
|
| MD5 |
8df63f8451f173e85e23f34b57d10e2e
|
|
| BLAKE2b-256 |
788091cfc4e818ea536ae52abea2b3d5b3eef4cc4129424d13be0e2bec8c5dcc
|
File details
Details for the file task_6_syrkin-0.0.4-py3-none-any.whl.
File metadata
- Download URL: task_6_syrkin-0.0.4-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fadf7f59f8c4da682e529d838b4743bf7e821d8f8482f03ade75b3baa06417d
|
|
| MD5 |
4dbf8083c3f102633eefc30c47703c84
|
|
| BLAKE2b-256 |
e16fb55435e99621c5b7eed4c45c6e31e6c9fda9c002a5ed6dd4b09ffc186158
|