-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
series - Fixes series expansion around float failing with NotImplementedError #23456
Conversation
✅ Hi, I am the SymPy bot (v163). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.11. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
CC @jksuom |
Benchmark results from GitHub Actions Lower numbers are good, higher numbers are bad. A ratio less than 1 Significantly changed benchmark results (PR vs master) Significantly changed benchmark results (master vs previous release) before after ratio
[77f1d79c] [ed4e06ef]
<sympy-1.10.1^0>
+ 114±0.8ms 202±3ms 1.77 sum.TimeSum.time_doit
Full benchmark results can be found as artifacts in GitHub Actions |
When I'm trying to add a test case, with the following change - Even though the answer is correct, I'm getting an diff --git a/sympy/series/tests/test_series.py b/sympy/series/tests/test_series.py
index 34b598a415..f526b3bf0d 100644
--- a/sympy/series/tests/test_series.py
+++ b/sympy/series/tests/test_series.py
@@ -362,3 +362,11 @@ def test_issue_21245():
def test_issue_21938():
expr = sin(1/x + exp(-x)) - sin(1/x)
assert expr.series(x, oo) == (1/(24*x**4) - 1/(2*x**2) + 1 + O(x**(-6), (x, oo)))*exp(-x)
+
+
+def test_issue_23432():
+ expr = 1/sqrt(1 - x**2)
+ assert expr.series(x, 0.5) == \
+ 0.769800358919501 + 1.539600717839*(x - 0.5)**2 +\
+ 2.39493444997178*(x - 0.5)**3 + 4.33369090947275*(x - 0.5)**4 +\
+ 7.75502583800386*(x - 0.5)**5 + 0.769800358919501*x + O((x - 1/2)**6, (x, 1/2)) |
Lines 1735 to 1739 in a189657
Two changes: First, two lines between lines 1736 and 1737:
Second, 4 lines in place of 1739:
|
Comparisons of expressions containing Floats are notoriously hard to implement. It seems that when a Float is printed, it is truncated, and when the printed expression is input and sympified, it will again be slightly modified so it will often not be exactly the same as the original Float. Comparison of printed strings is sometimes used as a work-around, but that should probably be avoided. It is possible to use |
@jksuom I have added the test case - |
The purpose of the tests is to give an indication of possible regressions when new code is added.
|
Can you squash the commits? A single commit with a message would suffice. |
Thanks, this is ready to go. |
References to other Issues or PRs
Brief description of what is fixed or changed
Fixes #23432 and now
series(1/sqrt(1-x**2), x, 0.5)
returnsinstead of
NotImplementedError
.Other comments
Release Notes
series
and now series expansion with float does not giveNotImplementedError
.