mirror of
https://github.com/IAmTomShaw/f1-race-replay.git
synced 2026-05-09 16:35:49 +02:00
[PR #189] [CLOSED] fixed a few issues #207
Labels
No labels
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/f1-race-replay#207
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/189
Author: @PooSmacker
Created: 1/23/2026
Status: ❌ Closed
Base:
main← Head:main📝 Commits (1)
442f72frefactored to useargparse:📊 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.