-
Notifications
You must be signed in to change notification settings - Fork 203
Replace numpy with math #2074
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace numpy with math #2074
Conversation
|
👋 @vyagubov |
WalkthroughThis PR removes numpy usage from a JSON utility by switching Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
pyproject.toml (1)
16-16: Clarify or update the comment about Python version constraints.The comment mentions "numpy 1.26.x(which was removed)" but still references it as a reason for Python version limits. Since numpy has been removed from dependencies, this is confusing. Either remove the numpy reference entirely or clarify that the Python version constraint is now solely due to dbt v1.9 compatibility.
Apply this diff to clarify the comment:
-# matches the versions supported by dbt as of v1.9, which are probably due to the limits of numpy 1.26.x(which was removed) +# matches the versions supported by dbt as of v1.9
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
elementary/utils/json_utils.py(2 hunks)pyproject.toml(1 hunks)
🔇 Additional comments (2)
elementary/utils/json_utils.py (2)
2-2: LGTM! Clean replacement of numpy with standard library.The import change from numpy to Python's built-in
mathmodule is appropriate and eliminates an external dependency.Also applies to: 5-5
87-90: LGTM! Functionally equivalent replacement.The replacement of
np.isinf()andnp.isnan()withmath.isinf()andmath.isnan()is correct. Since line 86 confirmsobjis a float, the standard library functions provide identical behavior to their numpy counterparts for single values. Verified that numpy has been completely removed from the codebase.
|
I will upgrade python version to 3.13 in the next PR, if that one goes well. |
|
Hey @vyagubov ! We're taking a look, would be happy to get the contribution for Python 3.13 as well 🙌 |
|
@NoyaOffer |
See #1962
Summary by CodeRabbit
Refactor
Chores
✏️ Tip: You can customize this high-level summary in your review settings.