From: John H. <jdh...@ac...> - 2004-12-01 04:43:10
|
>>>>> "Jon" == Jon Peirce <Jon...@no...> writes: Jon> Actually, since it's the package that most users probably Jon> actually want, would it be more suitable to move Jon> matplotlib.matlab into matplotlib itself? Then we could Jon> simply Jon> import matplotlib Jon> Obviously that would mix the main user routines (plot()...) Jon> with the more administrative namespace (get_backend(), Jon> is_interactive()...) and maybe you'd want to move those into Jon> a separate (always imported) subpackage along the lines of Jon> matplotlib.res? It is technically possible to reorganize the code to support this, but it would break a lot of code in a nontrivial way. While it is trivial to search and replace instances of 'from matplotlib.matlab' with 'from matplotlib.pylab' and so on, it would not be trivial to port scripts that were using the matplotlib admin funcs after the kind of reorganization this would entail. But your post did give me an idea that might satisfy everyone and provide the ease of use your idea suggests. If we migrate matplotlib.matlab to matplotlib.pylab as discussed, *and* add an additional file pylab.py that resides in site-packages and is a one liner from matplotlib.pylab import * then we preserve the easy conversion from old namespace to new namespace while making it easy for script writers to do from pylab import * Plea to distutils gurus: if you can figure out a way in the current matplotlib setup.py setup to get a module named pylab.py into site-packages, please advise! The current module layout is somewhat complicated and already stretches my distutils capabilities. Of course if you were using Fernando's wonderful pylab feature in ipython, it would be a trifle concern anyhow, since the import is done automagically. JDH |