Closed spyder-bot closed 7 years ago
From ccordoba12 on 2013-12-11T17:57:24Z
This problem comes from this import statement
from sympy import *
because Sympy's plot function is in the sympy namespace.
We could add a warning about it but this is not our fault, it's just how the Sympy devs decided to load it for interactive work.
Status: Accepted
Labels: -Cat-Settings -Component-IPython -Component-Logic Cat-IPythonConsole MS-v2.3.1
From toddr...@gmail.com on 2014-01-14T07:04:05Z
There are at least two approaches that could fix this:
From ccordoba12 on 2014-01-14T07:18:33Z
My thoughts about them:
From toddr...@gmail.com on 2014-01-17T04:50:50Z
I think the best solution would be to separate out the options a bit. sympy makes it easy to import the pretty printing independently from the symbolic manipulation. So that can be made a seperate option. Then I would have an option to allow symbolic manipulation. Finally, in the matplotlib option, I would allow the use to pick between matplotlib and sympy plotting if sympy plotting is really important enough to warrant its own option.
"We plan to disable pylab mode for 2.3, which will improve things a bit."
Why? This seems to be an extremely important option for someone wanting to use spyder as a matlab replacement. In fact it is one of the main reasons I see people suggest using iPython in the first place, especially for people coming from matlab.
From ccordoba12 on 2014-01-17T07:53:37Z
About your best solution: I was also thinking to add more options to better control how we load sympy, but that's work for 2.4. However, the option we provide is not for power users, just for people who wants to easily solve integrals, derivatives, etc in Spyder. Power users can always load init_printing and the exact symbols they want to use to not conflict with pylab, but that's something a beginner can't sort out by himself.
About pylab: Sorry, I didn't express myself clearly. We are going to disable it by default, i.e. our IPython consoles won't come with pylab preloaded. But the option will be there (as it is right now) to enable it if you want to.
Labels: -MS-v2.3.1 MS-v2.4
From toddr...@gmail.com on 2014-01-17T09:20:35Z
"However, the option we provide is not for power users, just for people who wants to easily solve integrals, derivatives, etc in Spyder. Power users can always load init_printing and the exact symbols they want to use to not conflict with pylab, but that's something a beginner can't sort out by himself."
That is exactly mt point. A beginner who sees that there is an option for plotting, and an option for symbolic manipulation, isn't going to understand that the two options conflict and that enabling symbolic manipulation will somehow break all the plotting examples they are trying to follow. They will enable the options, try to plot, then probably get a weird error message about the number of data points without much hint where the error really lies.
From toddr...@gmail.com on 2013-12-05T13:56:49Z
Spyder Version: 2.2.5 Python Version: 2.7.5 Qt Version : 4.8.5, PyQt4 (API v2) 4.10.3 on Linux IPython >=0.13 : 1.1.0 (OK) matplotlib >=1.0: 1.3.1 (OK) pep8 >=0.6 : 1.4.6 (OK) pyflakes >=0.5.0: 0.7.3 (OK) pylint >=0.25 : 1.0.0 (OK) rope >=0.9.2 : 0.9.4 (OK) sphinx >=0.6.6 : 1.2b3 (OK) sympy >=0.7.0 : 0.7.3 (OK)
What steps will reproduce the problem?
What is the expected output? A matplotlib figure with a diagonal line
What do you see instead? Traceback (most recent call last):
File "", line 1, in
plot(arange(20))
File "/usr/lib/python2.7/site-packages/sympy/plotting/plot.py", line 1195, in plot args = map(sympify, args)
File "/usr/lib/python2.7/site-packages/sympy/core/sympify.py", line 256, in sympify rational=rational) for x in a])
MemoryError
Please provide any additional information below
. This indicates that the sympy "plot" function is overriding the "matplotlib" one. There is no indication from the preferences dialog that enabling symbolic math will also enable sympy plotting. The dialog only talks about sympy in reference to symbolic operations and the output style.
Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1665