From ee9d9770f8fe8afcda8c5ea344886d3b97ed9b47 Mon Sep 17 00:00:00 2001 From: TreeOfJuly Date: Fri, 4 Oct 2024 19:06:49 -0400 Subject: [PATCH 1/2] Initial changes --- sympy/core/mul.py | 6 ++++-- sympy/series/tests/test_series.py | 12 ++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/sympy/core/mul.py b/sympy/core/mul.py index 1e5197e04af5..864d23fbfc79 100644 --- a/sympy/core/mul.py +++ b/sympy/core/mul.py @@ -1959,17 +1959,19 @@ def coeff_exp(term, x): lt = term.leadterm(x) except ValueError: return term, S.Zero + except PoleError: + return term, S.Zero return lt ords = [] try: for t in self.args: - coeff, exp = t.leadterm(x) + coeff, exp = coeff_exp(t, x) # changed from leadterm to coeff_exp if not coeff.has(x): ords.append((t, exp)) else: - raise ValueError + raise ValueError("Leading coefficient has a x within it.") n0 = sum(t[1] for t in ords if t[1].is_number) facs = [] diff --git a/sympy/series/tests/test_series.py b/sympy/series/tests/test_series.py index 3313b8e6ee48..55283d00ea7d 100644 --- a/sympy/series/tests/test_series.py +++ b/sympy/series/tests/test_series.py @@ -406,3 +406,15 @@ def test_issue_24266(): def test_issue_26856(): raises(ValueError, lambda: (2**x).series(x, oo, -1)) + +def test_issue_27109(): + from sympy import symbols, exp, sqrt, pi, oo, erf, series + + x = symbols('x', positive=True) + + f2 = 2 * erf(x) + s2 = series(f2, x, x0=oo, n=3) + + expected_s2 = -((2 / x) + O(x**(-3), (x, oo))) * (exp(-x**2) / sqrt(pi)) + 2 + + assert s2.equals(expected_s2) From bde7c9a6f2c8cc2b8ce76a3bf6c859f418778358 Mon Sep 17 00:00:00 2001 From: Julio Cesar Arboleda <166689388+TreeOfJuly@users.noreply.github.com> Date: Fri, 4 Oct 2024 19:08:02 -0400 Subject: [PATCH 2/2] Update README.md --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index b843e6712bbc..a7984ea866d3 100644 --- a/README.md +++ b/README.md @@ -211,10 +211,7 @@ place. Ondřej Čertík is still active in the community but is too busy with work and family to play a lead development role. Since then, a lot more people have joined the development and some -people have also left. You can see the full list in doc/src/aboutus.rst, -or online at: - - +people have also left. You can see the full list in doc/src/aboutus.rst. The git history goes back to 2007 when development moved from svn to hg. To see the history before that point, look at