Skip to content

[core][doc] Add raises to docstrings and fix related issues#246

Merged
forfudan merged 3 commits into
mainfrom
dev
Jun 6, 2026
Merged

[core][doc] Add raises to docstrings and fix related issues#246
forfudan merged 3 commits into
mainfrom
dev

Conversation

@forfudan

@forfudan forfudan commented Jun 6, 2026

Copy link
Copy Markdown
Owner

This PR focuses on documentation correctness and clarity across Decimo’s Mojo codebase, primarily by expanding docstrings with explicit Raises: sections and converting some file header comments into proper module docstrings.

Changes:

  • Add/standardize Raises: sections across many public APIs (BigDecimal/BigInt/BigUInt/Decimal128/TOML utilities, CLI engine, test helpers).
  • Improve module-level documentation by replacing banner-style comments with descriptive module docstrings and adding missing package/module docstrings.
  • Minor benchmark helper adjustment: _pad() now uses String.byte_length() when computing padding.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR focuses on documentation correctness and clarity across Decimo’s Mojo codebase, primarily by expanding docstrings with explicit Raises: sections and converting some file header comments into proper module docstrings.

Changes:

  • Add/standardize Raises: sections across many public APIs (BigDecimal/BigInt/BigUInt/Decimal128/TOML utilities, CLI engine, test helpers).
  • Improve module-level documentation by replacing banner-style comments with descriptive module docstrings and adding missing package/module docstrings.
  • Minor benchmark helper adjustment: _pad() now uses String.byte_length() when computing padding.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
tests/bigdecimal/test_bigdecimal_methods.mojo Docstring wording/punctuation tweaks for the test module header.
tests/bigdecimal/test_bigdecimal_arithmetics.mojo Docstring list formatting tweaks.
src/decimo/toml/parser.mojo Adds Raises: sections to TOML public APIs and parse helpers.
src/decimo/tests.mojo Adds Raises: sections to shared test/benchmark helpers.
src/decimo/rational/rational.mojo Adds Raises: sections for Rational arithmetic operators.
src/decimo/rational/comparison.mojo New module docstring for Rational comparison operations.
src/decimo/rational/arithmetics.mojo New module docstring for Rational arithmetic operations.
src/decimo/decimal128/utility.mojo Replaces header comments with a module docstring.
src/decimo/decimal128/decimal128.mojo Adds Raises: sections for Decimal128 operations.
src/decimo/decimal128/init.mojo Adds package docstring for decimal128 subpackage.
src/decimo/biguint/biguint.mojo Adds Raises: sections for multiple BigUInt methods.
src/decimo/biguint/arithmetics.mojo Adds Raises: sections to division helpers.
src/decimo/bigint10/bigint10.mojo Adds Raises: sections and expands docstring(s).
src/decimo/bigint/number_theory.mojo Adds Raises: sections for number theory helpers.
src/decimo/bigint/bigint.mojo Adds Raises: sections for conversion and modular ops.
src/decimo/bigfloat/bigfloat.mojo Adds Raises: sections for conversions and power forwarding.
src/decimo/bigdecimal/trigonometric.mojo Adds module docstring and Raises: sections for trig functions.
src/decimo/bigdecimal/rounding.mojo Adds Raises: sections to rounding helpers.
src/decimo/bigdecimal/exponential.mojo Adds Raises: sections to cache and exponential helpers.
src/decimo/bigdecimal/constants.mojo Adds Raises: sections for π computation helpers.
src/decimo/bigdecimal/bigdecimal.mojo Adds Raises: sections across many BigDecimal APIs.
src/decimo/bigdecimal/arithmetics.mojo Adds Raises: sections to arithmetic helpers.
src/cli/calculator/engine.mojo Documents propagated errors for evaluation helpers.
benches/decimal128/mojo/bigdec_ref.mojo _pad() now uses byte_length() when computing padding.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/bigdecimal/test_bigdecimal_methods.mojo Outdated
Comment thread src/decimo/toml/parser.mojo Outdated
Comment thread src/decimo/toml/parser.mojo Outdated
Comment thread src/decimo/toml/parser.mojo Outdated
Comment thread src/decimo/toml/parser.mojo Outdated
Comment thread src/decimo/bigdecimal/bigdecimal.mojo Outdated
Comment thread src/decimo/bigdecimal/bigdecimal.mojo Outdated
Comment thread src/decimo/bigdecimal/bigdecimal.mojo Outdated
Comment thread src/decimo/bigdecimal/bigdecimal.mojo Outdated
Comment thread src/decimo/bigdecimal/trigonometric.mojo Outdated
@forfudan forfudan merged commit e2e5a0b into main Jun 6, 2026
11 checks passed
@forfudan forfudan deleted the dev branch June 6, 2026 16:21
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