mirror of
https://github.com/IAmTomShaw/f1-race-replay.git
synced 2026-05-09 08:25:56 +02:00
[PR #271] [Refactor] Centralized configs, standardizes logging with loguru and add type safety #265
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#265
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/271
Author: @JoseCostaUni
Created: 4/2/2026
Status: 🔄 Open
Base:
main← Head:refactor/general-improvements📝 Commits (10+)
767f616added feature.md with some possible issues/features to work on044d280Merge branch 'IAmTomShaw:main' into mainde9362cfix: standardize logging framework across application16cac20removed magic numbers and put them in a centralizec config module494f5e9added missing filef19c048merged config refactor and loggin refactor branchesacf3a6fswitched log library to loguru and configs to pydantic-settingse937f60added type annotations and new exceptionsae38fe9removed some more magic numbers and substituted by the respective config0889ab9added missing configs📊 Changes
21 files changed (+1189 additions, -367 deletions)
View changed files
📝
main.py(+20 -14)📝
requirements.txt(+3 -1)📝
src/bayesian_tyre_model.py(+17 -15)📝
src/cli/race_selection.py(+2 -1)➕
src/config.py(+258 -0)📝
src/f1_data.py(+137 -59)📝
src/gui/insights_menu.py(+19 -16)📝
src/gui/pit_wall_window.py(+5 -2)📝
src/gui/race_selection.py(+29 -16)📝
src/insights/telemetry_stream_viewer.py(+5 -2)📝
src/interfaces/qualifying.py(+60 -44)📝
src/interfaces/race_replay.py(+144 -47)➕
src/lib/exceptions.py(+196 -0)➕
src/lib/logging.py(+64 -0)📝
src/lib/settings.py(+26 -6)📝
src/lib/time.py(+12 -9)📝
src/lib/tyres.py(+0 -2)📝
src/run_session.py(+26 -9)📝
src/services/stream.py(+51 -33)📝
src/tyre_degradation_integration.py(+19 -14)...and 1 more files
📄 Description
Summary
src/config.py— a single source of truth for all configuration usingpydantic-settings. All magic numbers (screen size, FPS, network ports, playback speeds, UI margins, etc.) are now named, documented, and overridable via environment variables or.env.{timestamp} | {level} | {module} | {message}format.src/lib/exceptions.pywith a structured exception hierarchy (F1DataError,StreamError,SessionNotAvailableError, etc.) replacing bareraise Exception(...)calls.stream.py,qualifying.py,f1_data.py, and others.Closes issue #270
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.