Skip to content

Upgrade pymath to 0.2.0#7429

Merged
youknowone merged 1 commit intoRustPython:mainfrom
youknowone:pymath
Mar 14, 2026
Merged

Upgrade pymath to 0.2.0#7429
youknowone merged 1 commit intoRustPython:mainfrom
youknowone:pymath

Conversation

@youknowone
Copy link
Member

@youknowone youknowone commented Mar 14, 2026

Summary by CodeRabbit

  • Updates

    • Upgraded core mathematical library dependencies to the latest stable version for improved performance and stability.
  • Bug Fixes

    • Enhanced error handling in mathematical computations to properly detect and report errors, ensuring calculations fail gracefully with clear feedback rather than silently continuing with invalid results.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: bde64e6c-579d-4b67-9c18-ee25546395dd

📥 Commits

Reviewing files that changed from the base of the PR and between 430eb5f and d33a34c.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • Cargo.toml
  • crates/stdlib/src/math.rs

📝 Walkthrough

Walkthrough

Updates the pymath dependency from version 0.1.5 to 0.2.0 while preserving features. Adds proper error handling in the sumprod function to convert pymath errors to Python exceptions instead of potentially ignoring them.

Changes

Cohort / File(s) Summary
Dependency Update
Cargo.toml
Bumped pymath dependency from 0.1.5 to 0.2.0, maintaining the same feature set (mul_add, malachite-bigint, complex).
Error Handling
crates/stdlib/src/math.rs
Enhanced sumprod function to properly handle errors from the float-path by mapping pymath::Error to Python exceptions and propagating errors via ?.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • ShaharNaveh

Poem

🐰 A version bump, so swift and neat,
Errors now handled, oh how sweet!
From 0.1 to 0.2 we go,
Exceptions mapped, no more woe! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Upgrade pymath to 0.2.0' directly and clearly describes the primary change: updating the pymath dependency to version 0.2.0, which is reflected in both the Cargo.toml dependency update and the error handling improvements in math.rs.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@youknowone youknowone marked this pull request as ready for review March 14, 2026 09:44
@youknowone youknowone merged commit 40fc7c2 into RustPython:main Mar 14, 2026
15 checks passed
@youknowone youknowone deleted the pymath branch March 14, 2026 11:13
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