From: Bruce S. <bas...@nc...> - 2010-10-08 18:05:31
|
In a private conversation Craig Struble has helped me see another structure that may be particularly appropriate. I believe his thinking is in part based on Guy's suggestions. Craig suggests implementing "a style of usage similar to the pylab module, where the really pythonish stuff is all in matplotlib.foo (where foo is some specific part of the API). A motivation for this is that I believe the community of folks using matplotlib, numpy, and scipy are potential users of visual. They will be familiar with the matplotlib model." In site-packages there is a single file pylab.py whose import gives you everything, and there's a folder matplotlib containing the stuff that pylab.py imports. Mimicking this, there would be a single file visual.py whose import gives you everything, and a folder (maybe named "vpython") that would contain all the submodules. I pointed out that while we can arrange things in such a way as to look like this, the actual implementation has to be "the other way round": for backward compatibility the visual folder has to remain essentially unchanged, and a second folder (maybe named "vpython") would have submodules that would import from the visual folder. The reason for this is that people may be importing from visual.primitives, and they are certainly importing from visual.graph. Bruce Sherwood P.S. Incidentally, in the new vpython folder there should be a new version of the graph module, because the existing one executes the dreaded "from visual import *", and changing that in visual.graph would cause problems, because people have been able to say just "from visual.graph import *" and get spheres as well as graphs. The new version, in the vpython folder, of course would not import spheres etc. |