Comment #8 on issue 3427 by asmeu...@gmail.com: sympy imports matplotlib on start-up
http://code.google.com/p/sympy/issues/detail?id=3427

Any idea how to cleanly fix this? All the solutions I can think of are very fragile. For example, if we just move all the imports inside methods (or use some kind of globals trick, which is more or less equivalent), then we risk missing an untested code path, which would then break (especially since the test coverage for the plotting module is not too hot). Or if someone writes methods with poor test coverage, the same would happen.

On the other hand, fancy magic like my deferred import is fragile in the other direction, in that it is too easy to make a seemingly innocuous change to the code that results in matplotlib being imported "too soon" (i.e., at sympy import time).

Is there a middle ground? And if not, which side would be preferable? At least in the second case, it is easy to check if it broke or not (import sympy, and either matplotlib was imported with it or it wasn't). But I am also concerned if it's too much magic.

And matplotlib is actually relatively simple. It is only used in three or four plotting files. NumPy on the other hand is used in a dozen files, again most of which have poor test coverage.

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to