Skip to content

[docstring][error] Fixes raises: sections in docstrings across codebase to show correct error types#199

Merged
forfudan merged 2 commits intodevfrom
error
Apr 9, 2026
Merged

[docstring][error] Fixes raises: sections in docstrings across codebase to show correct error types#199
forfudan merged 2 commits intodevfrom
error

Conversation

@forfudan
Copy link
Copy Markdown
Owner

@forfudan forfudan commented Apr 9, 2026

This PR updates docstring Raises: sections across Decimo to replace generic Error entries with specific error types (e.g., ValueError, OverflowError, ZeroDivisionError, ConversionError) so API documentation more accurately reflects runtime behavior.

Changes:

  • Standardized and expanded docstring Raises: sections across TOML parsing, numeric parsing, and multiple numeric types (Decimal128/Big*).
  • Replaced generic Error/DecimoError docstring entries with concrete error types used by the implementation.
  • Added missing Raises: sections to several functions that previously had none.

Copy link
Copy Markdown

Copilot AI left a comment

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 updates docstring Raises: sections across Decimo to replace generic Error entries with specific error types (e.g., ValueError, OverflowError, ZeroDivisionError, ConversionError) so API documentation more accurately reflects runtime behavior.

Changes:

  • Standardized and expanded docstring Raises: sections across TOML parsing, numeric parsing, and multiple numeric types (Decimal128/Big*).
  • Replaced generic Error/DecimoError docstring entries with concrete error types used by the implementation.
  • Added missing Raises: sections to several functions that previously had none.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/decimo/toml/parser.mojo Adds/clarifies Raises: ValueError in parser helpers and header/key parsing routines.
src/decimo/tests.mojo Documents ValueError raised by TOML test helper parse_file().
src/decimo/str.mojo Documents ValueError for malformed numeric strings in parse_numeric_string().
src/decimo/decimal128/special.mojo Documents ValueError/OverflowError for factorial helpers.
src/decimo/decimal128/rounding.mojo Documents OverflowError for rounding overflow cases.
src/decimo/decimal128/exponential.mojo Rewrites Raises: for power/root/log/exp functions to specific error types.
src/decimo/decimal128/decimal128.mojo Updates constructor/conversion docstrings to reflect ConversionError, ValueError, OverflowError.
src/decimo/decimal128/constants.mojo Documents ValueError for invalid constant selector inputs.
src/decimo/decimal128/arithmetics.mojo Documents OverflowError/ZeroDivisionError for arithmetic operations.
src/decimo/biguint/biguint.mojo Updates conversion/operator docstrings to specific overflow/conversion error types.
src/decimo/biguint/arithmetics.mojo Documents ZeroDivisionError/OverflowError/ValueError in arithmetic helpers.
src/decimo/bigint10/bigint10.mojo Adds/updates Raises: for parsing/conversion and arithmetic wrapper methods.
src/decimo/bigint10/arithmetics.mojo Documents ZeroDivisionError for division/modulo operations.
src/decimo/bigint/number_theory.mojo Documents ValueError for invalid modular arithmetic inputs.
src/decimo/bigint/exponential.mojo Documents ValueError for invalid sqrt/isqrt inputs.
src/decimo/bigint/bigint.mojo Updates string/overflow/division/power docstrings with more specific error types.
src/decimo/bigint/arithmetics.mojo Documents ZeroDivisionError and ValueError in division/power helpers.
src/decimo/bigfloat/bigfloat.mojo Documents RuntimeError/ConversionError for MPFR-backed operations.
src/decimo/bigdecimal/trigonometric.mojo Documents ValueError for undefined trig reciprocal cases.
src/decimo/bigdecimal/exponential.mojo Updates power/root/log/exp docstrings with specific error types.
src/decimo/bigdecimal/constants.mojo Documents ValueError on invalid precision for constants.
src/decimo/bigdecimal/bigdecimal.mojo Documents conversion-related ValueError/ConversionError cases.
src/decimo/bigdecimal/arithmetics.mojo Documents ZeroDivisionError for division/modulo functions.

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

Comment thread src/decimo/decimal128/exponential.mojo
Comment thread src/decimo/bigint/bigint.mojo Outdated
Comment thread src/decimo/bigint/bigint.mojo Outdated
Comment thread src/decimo/bigint10/bigint10.mojo Outdated
Comment thread src/decimo/bigdecimal/exponential.mojo Outdated
@forfudan forfudan merged commit b5567d9 into dev Apr 9, 2026
11 checks passed
@forfudan forfudan deleted the error branch April 9, 2026 22:47
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