Skip to content

#234 REFACTOR: Move BOT_NAMES to constants.py and rename Alfa to Alpha - #404

Merged
jarl-hoyem merged 4 commits into
mainfrom
234-bot-names-are-magic-numbers
May 29, 2026
Merged

jarl-hoyem merged 4 commits into
mainfrom
234-bot-names-are-magic-numbers

Conversation

@ahmedmajid22

Copy link
Copy Markdown
Collaborator

Closes #234

Changes

  • Added BOT_NAMES constant to constants.py with correct spelling: Alpha (was Alfa)
  • Added BOT_NAMES to __all__ in constants.py in alphabetical order
  • Imported BOT_NAMES in pickomino.py and replaced the hardcoded inline list
  • Fixed pre-existing unused type: ignore[override] mypy warning on render()

Testing

  • All pre-commit hooks pass (black, pylint, mypy, ruff, pyright, xenon, radon)
  • Sanity check passes for 1, 2, and 6 bots with correct Alpha name

@jarl-hoyem jarl-hoyem left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@jarl-hoyem jarl-hoyem left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the pre-commit fails due to the mypy comment change in line 199. Please reverse this. Unfortunately our CI does not run the pre-commit yet. See issues #342 and #316

@jarl-hoyem

Copy link
Copy Markdown
Collaborator

This works:

def render(  # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
    self,
) -> NDArray[np.uint8] | None:
    """Render the current game state.

@ahmedmajid22

Copy link
Copy Markdown
Collaborator Author

Applied the exact render() signature you requested. Had to skip the local mypy hook since mypy 2.1.0 flags type: ignore[override] as unused — consistent with the gap tracked in #342 and #316. All other hooks pass.

@jarl-hoyem
jarl-hoyem requested review from jarl-hoyem and removed request for RobMeetsAI May 29, 2026 16:51

@jarl-hoyem jarl-hoyem left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing unnecessary pyright suppression.

@jarl-hoyem
jarl-hoyem merged commit aca32c0 into main May 29, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bot names are magic numbers

3 participants