[PR #72] Cleaning up unused options and converting to argparse #116

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

📋 Pull Request Information

Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/72
Author: @atomicmaster
Created: 12/18/2025
Status: 🔄 Open

Base: mainHead: main


📝 Commits (2)

  • 2a2b458 Replacing manual arg parsing with argparse. Arguments are split into sections, session types are handled, you get a nicely formatted help with -h or --help, as expected, all options also have short versions, such as -y for --year and default values. The year default value defaults to the current year based on date.today().
  • cfa61ae Cleaning up the --chart option. It is never used and is not implemented beyond the run_arcade_replay function definition. On the off-chance that there was some reflection happening and it was indeed somehow being used, I also tested if it did anything, it did nothing. And it was being checked inside main(), which is well outside the main argument parsing section, which is either how it got forgotten in the first place, or just a poor decision. Either way, if it's something that is going to be implemented it just needs to be added to the argparse section.

📊 Changes

2 files changed (+40 additions, -30 deletions)

View changed files

📝 main.py (+39 -29)
📝 src/arcade_replay.py (+1 -1)

📄 Description

Cleaned up the --chart option:

  • It is never used outside of the run_arcade_replay() function definition
  • It didn't seem to do anything anyways
  • It was also being checked for directly inside main(), which was the wrong place for it anyways

Replaced argument parsing with argparse:

  • It is cleaner
  • It provides the -h/--help option with a nicely formatted help, which makes for a better user experience
  • It also implements shortened options, such as -y for --year, -r for --round, etc.
  • I separated the listing and session type sections into their own groups
  • I changed the default year to be based on date.today(), so it defaults to the current year regardless of the year (also, help reflects this as it displays the same value)

🔄 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/72 **Author:** [@atomicmaster](https://github.com/atomicmaster) **Created:** 12/18/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (2) - [`2a2b458`](https://github.com/IAmTomShaw/f1-race-replay/commit/2a2b458b8c8ee80b9dd898c9e76c87383311c016) Replacing manual arg parsing with argparse. Arguments are split into sections, session types are handled, you get a nicely formatted help with -h or --help, as expected, all options also have short versions, such as -y for --year and default values. The year default value defaults to the current year based on date.today(). - [`cfa61ae`](https://github.com/IAmTomShaw/f1-race-replay/commit/cfa61ae6ec2c728006e0a86b9051d58e20237f3f) Cleaning up the --chart option. It is never used and is not implemented beyond the run_arcade_replay function definition. On the off-chance that there was some reflection happening and it was indeed somehow being used, I also tested if it did anything, it did nothing. And it was being checked inside main(), which is well outside the main argument parsing section, which is either how it got forgotten in the first place, or just a poor decision. Either way, if it's something that is going to be implemented it just needs to be added to the argparse section. ### 📊 Changes **2 files changed** (+40 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `main.py` (+39 -29) 📝 `src/arcade_replay.py` (+1 -1) </details> ### 📄 Description Cleaned up the *--chart* option: - It is never used outside of the run_arcade_replay() function definition - It didn't seem to do anything anyways - It was also being checked for directly inside main(), which was the wrong place for it anyways Replaced argument parsing with argparse: - It is cleaner - It provides the -h/--help option with a nicely formatted help, which makes for a better user experience - It also implements shortened options, such as -y for --year, -r for --round, etc. - I separated the listing and session type sections into their own groups - I changed the default year to be based on date.today(), so it defaults to the current year regardless of the year (also, help reflects this as it displays the same value) --- <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#116
No description provided.