Skip to content

Commit d0ca1a9

Browse files
committed
Use ellipsis in fp.spherharm doctest
After python/cpython#121149 this was broken on CPython 3.14: _______________ [doctest] mpmath.functions.orthogonal.spherharm ____________ EXAMPLE LOCATION UNKNOWN, not showing all tests of that example ??? >>> fp.chop(fp.quad(lambda t,p: Y1(t,p)*Y2(t,p)*dS(t,p), *sphere)) Expected: 1.0000000000000007 Got: 1.0000000000000004 This particular failure could be fixed by: diff --git a/mpmath/ctx_base.py b/mpmath/ctx_base.py index 3309bfa..2ca2fac 100644 --- a/mpmath/ctx_base.py +++ b/mpmath/ctx_base.py @@ -110,7 +110,8 @@ def fdot(ctx, xs, ys=None, conjugate=False): cf = ctx.conj return sum((x*cf(y) for (x,y) in xs), ctx.zero) else: - return sum((x*y for (x,y) in xs), ctx.zero) + return ctx.mpc(sum(((x*y).real for (x,y) in xs), ctx.zero), + sum(((x*y).imag for (x,y) in xs), ctx.zero)) def fprod(ctx, args): prod = ctx.one But this is just one case for the whole test suite...
1 parent 7596816 commit d0ca1a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mpmath/function_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9850,7 +9850,7 @@
98509850
>>> Y2 = lambda t,p: fp.conj(fp.spherharm(l2,m2,t,p))
98519851
>>> l1 = l2 = 3; m1 = m2 = 2
98529852
>>> fp.chop(fp.quad(lambda t,p: Y1(t,p)*Y2(t,p)*dS(t,p), *sphere))
9853-
1.0000000000000007
9853+
1.000000000000000...
98549854
>>> m2 = 1 # m1 != m2
98559855
>>> print(fp.chop(fp.quad(lambda t,p: Y1(t,p)*Y2(t,p)*dS(t,p), *sphere)))
98569856
0.0

0 commit comments

Comments
 (0)