Skip to content

docs: add doc for agari class#224

Merged
Apricot-S merged 2 commits intomasterfrom
add-agari-docs
Feb 24, 2026
Merged

docs: add doc for agari class#224
Apricot-S merged 2 commits intomasterfrom
add-agari-docs

Conversation

@Nihisil
Copy link
Contributor

@Nihisil Nihisil commented Feb 23, 2026

@Nihisil Nihisil added this to the v2.0.0 milestone Feb 23, 2026
@Nihisil Nihisil requested a review from Apricot-S as a code owner February 23, 2026 04:02
"FBT001", # boolean-type-hint-positional-argument
"FBT002", # boolean-default-value-positional-argument
"FBT003", # boolean-positional-value-in-call
"D100", # missing-docstring-in-public-module
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think forcing module-level docstrings is a bit overkill for us. Our modules are relatively small and mostly single-purpose. Having docstrings for classes and public methods should be enough

Copy link
Collaborator

Choose a reason for hiding this comment

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

I generally agree, but I think the "34 tiles format" and "136 tiles format" should be explained in a module-level docstring somewhere. I think mahjong/__init__.py would be a good place to do this. What do you think?

Example:

riichienv-core (https://crates.io/crates/riichienv-core) README

Tile representation

  • 136-format: Each of 34 tile types x 4 copies (indices 0-135), used for actual game state
  • 34-format: Normalized tile type indices (0-33), used for calculations
  • MPSZ notation: 1m-9m (man), 1p-9p (pin), 1s-9s (sou), 1z-7z (honors)
  • Red fives are represented at indices 16, 52, 88 in 136-format

xiangting-py README

Image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, we can write module comments where it is suited, no problem here.

I just don't want to have it forced for every module in the project through linter.

"FBT001", # boolean-type-hint-positional-argument
"FBT002", # boolean-default-value-positional-argument
"FBT003", # boolean-positional-value-in-call
"D100", # missing-docstring-in-public-module
Copy link
Collaborator

Choose a reason for hiding this comment

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

I generally agree, but I think the "34 tiles format" and "136 tiles format" should be explained in a module-level docstring somewhere. I think mahjong/__init__.py would be a good place to do this. What do you think?

Example:

riichienv-core (https://crates.io/crates/riichienv-core) README

Tile representation

  • 136-format: Each of 34 tile types x 4 copies (indices 0-135), used for actual game state
  • 34-format: Normalized tile type indices (0-33), used for calculations
  • MPSZ notation: 1m-9m (man), 1p-9p (pin), 1s-9s (sou), 1z-7z (honors)
  • Red fives are represented at indices 16, 52, 88 in 136-format

xiangting-py README

Image

@Nihisil Nihisil requested a review from Apricot-S February 24, 2026 04:28
@Apricot-S Apricot-S merged commit b801bd9 into master Feb 24, 2026
9 checks passed
@Apricot-S Apricot-S deleted the add-agari-docs branch February 24, 2026 10:51
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.

2 participants