latex rendering infinite recusion during Matrix display
ivanistheone opened this issue · 3 comments
I ran into a weird latex display bug. To reproduce try running this on http://live.sympy.org
Matrix([[1/sqrt(2), 1/sqrt(6), -1/sqrt(3)]])
It goes into a recusive loop and then spits out a long stacktrace:
Traceback (most recent call last):
File "/b/d/h/a/s~sympy-live-hrd/46.393.../shell.py", line 373, in displayhook print stringify_func(arg)
File "/b/d/h/a/s~sympy-live-hrd/46.393.../shell.py", line 81, in <lambda> 'latex': lambda arg: latex(arg, mode="equation*"),
...hundreds of lines...
File "/b/d/h/a/s~sympy-live-hrd/46.393.../sympy/sympy/printing/latex.py", line 368, in _print_Mul tex += convert(expr)
File "/b/d/h/a/s~sympy-live-hrd/46.393.../sympy/sympy/printing/latex.py", line 348, in convert term_tex = self._print(term)
File "/b/d/h/a/s~sympy-live-hrd/46.393.../sympy/sympy/printing/printer.py", line 257, in _print return getattr(self, printmethod)(expr, *args, **kwargs)
File "/b/d/h/a/s~sympy-live-hrd/46.393.../sympy/sympy/printing/latex.py", line 368, in _print_Mul tex += convert(expr)
File "/b/d/h/a/s~sympy-live-hrd/46.393.../sympy/sympy/printing/latex.py", line 348, in convert term_tex = self._print(term)
File "/b/d/h/a/s~sympy-live-hrd/46.393.../sympy/sympy/printing/printer.py", line 257, in _print return getattr(self, printmethod)(expr, *args, **kwargs)
File "/b/d/h/a/s~sympy-live-hrd/46.393.../sympy/sympy/printing/latex.py", line 326, in _print_Mul expr = -expr
File "/b/d/h/a/s~sympy-live-hrd/46.393.../sympy/sympy/core/expr.py", line 112, in __neg__ return Mul(S.NegativeOne, self)
File "/b/d/h/a/s~sympy-live-hrd/46.393.../sympy/sympy/core/cache.py", line 93, in wrapper retval = cfunc(*args, **kwargs)
File "/b/d/h/a/s~sympy-live-hrd/46.393.../sympy/sympy/core/compatibility.py", line 881, in wrapper key = make_key(args, kwds, typed) if kwds or typed else args
File "/b/d/h/a/s~sympy-live-hrd/46.393.../sympy/sympy/core/compatibility.py", line 813, in _make_key return _HashedSeq(key)
File "/b/d/h/a/s~sympy-live-hrd/46.393.../sympy/sympy/core/compatibility.py", line 791, in __init__ self.hashvalue = hash(tup)
RuntimeError: maximum recursion depth exceeded while calling a Python object
Let me know if I can help fix this somehow.
Hmm, I can't get that to happen again. It's looking like something went wrong in SymPy's internals. Were there other statements before this one?
(SymPy Live works by pickling everything after each statement and reloading it when you give the next one; it's been a source of issues and I would guess something went wrong somewhere along the way.)
Hi David,
Yes you're right that it works now. That's funny though, because I tried yesterday in incognito mode in both FF and Chrome before posting the bugreport. Perhaps it was a transient thing? I'll let you know if it comes up again but for now voting to close.
That's interesting, thanks for the followup. Not really sure where the problem is here, then, but hopefully it was just a one-time thing.