[PR #189] [CLOSED] fixed a few issues #207

Closed
opened 2026-05-07 00:19:12 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/189
Author: @PooSmacker
Created: 1/23/2026
Status: Closed

Base: mainHead: main


📝 Commits (1)

  • 442f72f refactored to use argparse:

📊 Changes

2 files changed (+101 additions, -84 deletions)

View changed files

📝 main.py (+61 -52)
📝 src/f1_data.py (+40 -32)

📄 Description

replaced manual sys.argv parsing with the standard argparse library.
this provides better argument handling, automatic type conversion, and a generated help message (--help).
maintained full backward compatibility with the existing cli flags used by the gui and cli loaders.
fixed cache & pathing:
sanitized filenames fixed an issue where filenames containing colons (from session names) would fail on Windows.
constants: added CACHE_DIR (.fastf1-cache) and COMPUTED_DIR (computed_data) constants to the top of the file for easier configuration and to prevent hardcoding strings in multiple places.
cleaned up arguments: replaced the direct inspection of sys.argv for --refresh-data with a clean function argument refresh=False.
optimized multiprocessing:
safe defaults: added MAX_WORKERS = 4 constant to limit the number of parallel processes.
no more oom: the code now spawns min(MAX_WORKERS, cpu_count(), n_drivers) processes instead of one per driver (which could spawn 20+ heavy processes and crash systems with limited RAM).

tested all changes, made sure the cli arg parsing works (eg, python main.py --list-rounds --year 2024). made sure that fetching race telemetry works, correctly caches data, and saves it to the computed_data directory with a valid Windows filename.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/IAmTomShaw/f1-race-replay/pull/189 **Author:** [@PooSmacker](https://github.com/PooSmacker) **Created:** 1/23/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`442f72f`](https://github.com/IAmTomShaw/f1-race-replay/commit/442f72ff98af271d94e1ca033d8ae5cb120ce4ca) refactored to use `argparse`: ### 📊 Changes **2 files changed** (+101 additions, -84 deletions) <details> <summary>View changed files</summary> 📝 `main.py` (+61 -52) 📝 `src/f1_data.py` (+40 -32) </details> ### 📄 Description replaced manual sys.argv parsing with the standard argparse library. this provides better argument handling, automatic type conversion, and a generated help message (--help). maintained full backward compatibility with the existing cli flags used by the gui and cli loaders. fixed cache & pathing: sanitized filenames fixed an issue where filenames containing colons (from session names) would fail on Windows. constants: added CACHE_DIR (.fastf1-cache) and COMPUTED_DIR (computed_data) constants to the top of the file for easier configuration and to prevent hardcoding strings in multiple places. cleaned up arguments: replaced the direct inspection of sys.argv for --refresh-data with a clean function argument refresh=False. optimized multiprocessing: safe defaults: added MAX_WORKERS = 4 constant to limit the number of parallel processes. no more oom: the code now spawns min(MAX_WORKERS, cpu_count(), n_drivers) processes instead of one per driver (which could spawn 20+ heavy processes and crash systems with limited RAM). tested all changes, made sure the cli arg parsing works (eg, python main.py --list-rounds --year 2024). made sure that fetching race telemetry works, correctly caches data, and saves it to the computed_data directory with a valid Windows filename. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 00:19:12 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/f1-race-replay#207
No description provided.