[PR #93] Refactor: Modularize codebase and fix static analysis errors #135

Open
opened 2026-05-07 00:18:50 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/93
Author: @matthewdotpy
Created: 12/20/2025
Status: 🔄 Open

Base: mainHead: main


📝 Commits (5)

  • 0bea00c Refactor src directory into modular architecture and fix type errors
  • d82a5fa Fix data processing error and update README with new structure
  • ff1ea0c Add CI workflow, contributing guidelines, and fix type errors
  • 54a384b Fix for conflict on pull merge
  • f3246d2 Add recent changes to modular system :)

📊 Changes

31 files changed (+2217 additions, -2294 deletions)

View changed files

.github/workflows/ci.yml (+39 -0)
📝 .gitignore (+1 -0)
CONTRIBUTING.md (+90 -0)
📝 README.md (+7 -3)
📝 main.py (+3 -1)
pyproject.toml (+10 -0)
src/__init__.py (+0 -0)
📝 src/arcade_replay.py (+1 -2)
src/data/__init__.py (+0 -0)
src/data/cache.py (+16 -0)
src/data/processing.py (+513 -0)
src/data/session.py (+57 -0)
src/data/telemetry.py (+118 -0)
src/f1_data.py (+0 -861)
src/interfaces/__init__.py (+0 -0)
📝 src/interfaces/qualifying.py (+34 -15)
📝 src/interfaces/race_replay.py (+15 -18)
src/lib/__init__.py (+0 -0)
📝 src/lib/time.py (+19 -10)
src/ui/__init__.py (+0 -0)

...and 11 more files

📄 Description

This PR refactors the codebase to improve maintainability by splitting monolithic files into a modular architecture. It also addresses technical debt by fixing static analysis errors and updating deprecated library calls.

Changes

  • Refactored f1_data.py into a modular data package (processing, session, cache)
  • Refactored ui_components.py into a modular ui package (leaderboard, controls, etc.)
  • Added comprehensive type hints to resolve static analysis errors
  • Replaced deprecated Arcade drawing methods with modern equivalents
  • Fixed potential runtime errors related to
  • None values and color lookups

Updated README.md to reflect the new project structure
Added CONTRIBUTING.md to reflect the new project structure

Added workflow for linting/ static type checking etc.

I told you I would make another commit soon :)


🔄 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/93 **Author:** [@matthewdotpy](https://github.com/matthewdotpy) **Created:** 12/20/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (5) - [`0bea00c`](https://github.com/IAmTomShaw/f1-race-replay/commit/0bea00c4c83b02e19b416a08d35516960ff5f356) Refactor src directory into modular architecture and fix type errors - [`d82a5fa`](https://github.com/IAmTomShaw/f1-race-replay/commit/d82a5fadf5d7d913b72b443cf7f295f02ba94bb2) Fix data processing error and update README with new structure - [`ff1ea0c`](https://github.com/IAmTomShaw/f1-race-replay/commit/ff1ea0c2b842acd134642cc0bdaba2c3aa97ec13) Add CI workflow, contributing guidelines, and fix type errors - [`54a384b`](https://github.com/IAmTomShaw/f1-race-replay/commit/54a384b66b1d56321913aceedda3b1b62cc9e112) Fix for conflict on pull merge - [`f3246d2`](https://github.com/IAmTomShaw/f1-race-replay/commit/f3246d2b260b782a874f5267892e440b3b96891b) Add recent changes to modular system :) ### 📊 Changes **31 files changed** (+2217 additions, -2294 deletions) <details> <summary>View changed files</summary> ➕ `.github/workflows/ci.yml` (+39 -0) 📝 `.gitignore` (+1 -0) ➕ `CONTRIBUTING.md` (+90 -0) 📝 `README.md` (+7 -3) 📝 `main.py` (+3 -1) ➕ `pyproject.toml` (+10 -0) ➕ `src/__init__.py` (+0 -0) 📝 `src/arcade_replay.py` (+1 -2) ➕ `src/data/__init__.py` (+0 -0) ➕ `src/data/cache.py` (+16 -0) ➕ `src/data/processing.py` (+513 -0) ➕ `src/data/session.py` (+57 -0) ➕ `src/data/telemetry.py` (+118 -0) ➖ `src/f1_data.py` (+0 -861) ➕ `src/interfaces/__init__.py` (+0 -0) 📝 `src/interfaces/qualifying.py` (+34 -15) 📝 `src/interfaces/race_replay.py` (+15 -18) ➕ `src/lib/__init__.py` (+0 -0) 📝 `src/lib/time.py` (+19 -10) ➕ `src/ui/__init__.py` (+0 -0) _...and 11 more files_ </details> ### 📄 Description This PR refactors the codebase to improve maintainability by splitting monolithic files into a modular architecture. It also addresses technical debt by fixing static analysis errors and updating deprecated library calls. Changes - Refactored `f1_data.py` into a modular `data` package (processing, session, cache) - Refactored `ui_components.py` into a modular `ui` package (leaderboard, controls, etc.) - Added comprehensive type hints to resolve static analysis errors - Replaced deprecated Arcade drawing methods with modern equivalents - Fixed potential runtime errors related to - None values and color lookups Updated `README.md` to reflect the new project structure Added `CONTRIBUTING.md` to reflect the new project structure Added workflow for linting/ static type checking etc. _I told you I would make another commit soon :)_ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#135
No description provided.