On Wed, Nov 13, 2019 at 6:15 PM E. Madison Bray wrote:
>
> Testing this on Windows + Python 3 for the first time in a while.
> During the docbuild it crashes while generating one of the plots, with
> some call to maxima resulting in:
>
> RuntimeError: ECL says: #
>
> I'll see if I can get this in any other context. Has anyone else seen
> problems like this on Python 3?
How to reproduce:
sage: f = piecewise([((0,pi/2), -1), ((pi/2,pi), 2)])
sage: s5 = f.fourier_series_partial_sum(5)
---
RuntimeError Traceback (most recent call last)
in ()
> 1 s5 = f.fourier_series_partial_sum(Integer(5))
/home/embray/src/sagemath/sage-python3/local/lib/python3.7/site-packages/sage/symbolic/expression.pyx
in sage.symbolic.expression._eval_on_operands.new_f
(build/cythonized/sage/symbolic/expression.cpp:67434)()
12688 new_args = list(ex._unpack_operands())
12689 new_args.extend(args)
> 12690 return f(ex, *new_args, **kwds)
12691 return new_f
12692
/home/embray/src/sagemath/sage-python3/local/lib/python3.7/site-packages/sage/functions/piecewise.py
in fourier_series_partial_sum(self, parameters, variable, N, L)
1347 L = (self.domain().sup() - self.domain().inf()) / 2
1348 x = self.default_variable()
-> 1349 a0 = self.fourier_series_cosine_coefficient(0, L)
1350 result = a0/2 +
sum([(self.fourier_series_cosine_coefficient(n, L)*cos(n*pi*x/L) +
1351
self.fourier_series_sine_coefficient(n, L)*sin(n*pi*x/L))
/home/embray/src/sagemath/sage-python3/local/lib/python3.7/site-packages/sage/symbolic/expression.pyx
in sage.symbolic.expression._eval_on_operands.new_f
(build/cythonized/sage/symbolic/expression.cpp:67434)()
12688 new_args = list(ex._unpack_operands())
12689 new_args.extend(args)
> 12690 return f(ex, *new_args, **kwds)
12691 return new_f
12692
/home/embray/src/sagemath/sage-python3/local/lib/python3.7/site-packages/sage/functions/piecewise.py
in fourier_series_cosine_coefficient(self, parameters, variable, n, L)
1179 a = interval.lower()
1180 b = interval.upper()
-> 1181 result += (f*cos(pi*x*n/L)).integrate(x, a, b)
1182 return SR(result/L0).simplify_trig()
1183
/home/embray/src/sagemath/sage-python3/local/lib/python3.7/site-packages/sage/symbolic/expression.pyx
in sage.symbolic.expression.Expression.integral
(build/cythonized/sage/symbolic/expression.cpp:64542)()
12370 R = ring.SR
12371 return R(integral(f, v, a, b, **kwds))
> 12372 return integral(self, *args, **kwds)
12373
12374 integrate = integral
/home/embray/src/sagemath/sage-python3/local/lib/python3.7/site-packages/sage/symbolic/integration/integral.py
in integrate(expression, v, a, b, algorithm, hold)
921 return indefinite_integral(expression, v, hold=hold)
922 else:
--> 923 return definite_integral(expression, v, a, b, hold=hold)
924
925
/home/embray/src/sagemath/sage-python3/local/lib/python3.7/site-packages/sage/symbolic/function.pyx
in sage.symbolic.function.BuiltinFunction.__call__
(build/cythonized/sage/symbolic/function.cpp:12262)()
1025 res = self._evalf_try_(*args)
1026 if res is None:
-> 1027 res = super(BuiltinFunction, self).__call__(
1028 *args, coerce=coerce, hold=hold)
1029
/home/embray/src/sagemath/sage-python3/local/lib/python3.7/site-packages/sage/symbolic/function.pyx
in sage.symbolic.function.Function.__call__
(build/cythonized/sage/symbolic/function.cpp:6938)()
484 for i from 0 <= i < len(args):
485 vec.push_back((args[i])._gobj)
--> 486 res = g_function_evalv(self._serial, vec, hold)
487 elif self._nargs == 1:
488 res = g_function_eval1(self._serial,
/home/embray/src/sagemath/sage-python3/local/lib/python3.7/site-packages/sage/symbolic/function.pyx
in sage.symbolic.function.BuiltinFunction._evalf_or_eval_
(build/cythonized/sage/symbolic/function.cpp:13412)()
1113 res = self._evalf_try_(*args)
1114 if res is None:
-> 1115 return self._eval0_(*args)
1116 else:
1117 return res
/home/embray/src/sagemath/sage-python3/local/lib/python3.7/site-packages/sage/symbolic/integration/integral.py
in _eval_(self, f, x, a, b)
195 for integrator in self.integrators:
196 try:
--> 197 A = integrator(*args)
198 except (NotImplementedError, TypeError):
199 pass
/home/embray/src/sagemath/sage-python3/local/lib/python3.7/site-packages/sage/symbolic/integration/external.py
in maxima_integrator(expression, v, a, b)
44 result = maxima.sr_integral(ex