8000 Document every public class, method and function (hardening 4) by rafatahmed · Pull Request #122 · rafatahmed/Flahax · GitHub
[go: up one dir, main page]

Skip to content

Document every public class, method and function (hardening 4) - #122

Merged
rafatahmed merged 1 commit into
mainfrom
docs/public-docstrings
Oct 23, 2026
Merged

rafatahmed merged 1 commit into
mainfrom
docs/public-docstrings

Conversation

@rafatahmed
Copy link
Copy Markdown
Owner

Hardening 4, following #121: every public definition in the package has a docstring, and two guards keep it that way.

What changed

  • Docstrings: 93 added in src/flahax, covering 43 classes, 16 methods and 34 functions. Each says what the definition returns or represents and when it raises; the text comes from the code, for example the flahax mix question steps and their return values.
  • Guards:
    • ruff selects D101, D102 and D103 for src/ (other folders are excluded), so the CI style job enforces them;
    • tests/test_public_docstrings.py runs the same check without dependencies.
  • Comments: 8 comment paragraphs that the line-length rewrap in Enforce the 99-character line length (hardening 3b) #121 broke mid-sentence are reflowed with the same words.
  • Docs:
    • CONTRIBUTING gains a line on the rule;
    • API_REFERENCE.md is regenerated and now shows the new docstrings for public API items.

Evidence

  • Guards work:
    • the new test finds all 93 missing docstrings on main;
    • ruff flags D103 on a probe function without a docstring.
  • Behaviour unchanged: the 97 baseline results (26 formulas × 2 waters, plus the batch and session sweeps) are identical to main.
  • Checks pass:
    • full test suite, including PHREEQC;
    • tools/verify_distribution.py;
    • strict Sphinx build;
    • ruff check . and ruff format --check .;
    • LF line endings.

The 93 public definitions in src/flahax without a docstring now say
what they return or represent. Ruff checks D101-D103 for src/ in the
CI style job, and tests/test_public_docstrings.py checks the same with
no dependencies, so a new public definition needs a docstring.

Eight comment paragraphs that the 3b rewrap broke mid-sentence are
reflowed with the same words. CONTRIBUTING notes the rule, and
API_REFERENCE.md is regenerated with the new docstrings.
@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 Flahax | 🛠️ Build #35353555 | 📁 Comparing 86d3b15 against latest (131d750)

  🔍 Preview build  

1 file changed
± api/reference.html

@rafatahmed rafatahmed self-assigned this Oct 23, 2026
@rafatahmed
rafatahmed merged commit b42f121 into main Oct 23, 2026
8 checks passed
@rafatahmed
rafatahmed deleted the docs/public-docstrings branch October 23, 2026 12:07
rafatahmed added a commit that referenced this pull request Nov 7, 2026
Document every public class, method and function (hardening 4)
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.

1 participant

0