From: Alan W. I. <ir...@be...> - 2002-06-23 06:17:23
|
Earlier today I committed to CVS the new swig-based python interface that has been kindly donated by Gary Bishop. I have tested this new interface with pythondemos.py with both the single- and double-precision version of the plplot library, and it seems to work fine for all the xw??.py examples that are exercised by pythondemos.py. That is a welcome change since the number-one issue for most would-be python plplot users had been errors created when the old python interface which was only compatible with double precision was inadvertently used with the single-precision version of the plplot library. Implementation details swig version 1.3.11 or later is required for those using cvs (but not tarball release users, see discussion below). 1.3.11 is the Debian woody version you get with the swig1.3 package. If you have no swig or just swig-1.1.x you should download swig-1.3.13 from http://www.swig.org/download.html. To distinguish between double and single precision, swig needs to be run with a command-line switch. This is all taken care of by the new configuration. The point is that plplotcmodule.c_single and plplotcmodule.c_double are both produced at build time, but plplotcmodule.c is symlinked to only one of those in the configuration step depending on the --with-double configuration option. I have gone with this approach since I don't know in advance whether our tarball release users want to build the single or double-precision version of the plplot library so I will provide both plplotcmodule.c_single and plplotcmodule.c_double when I create a tarball release. In this way we won't be demanding all our tarball release users must have swig, and this approach is also consistent with our prior decisions about some of our other generated files such as configure. swig-1.3.11 still has some issues with documentation strings so part of the process of creating plplotcmodule.c_single and plplotcmodule.c_double requires a python script (makedocstrings.py) to take care of the problem. This is all handled automatically by the Makefile. The Makefile automatically creates both the plplot_widget and plplotc extension modules. The former includes useful widget support functions, and the latter makes the complete raw common C API of the plplot library available to python (with redundant dimension information automatically dropped from the argument lists). Finally, there is also a new python module called plplot (implemented with plplot.py) which is a user-friendly python wrapper for the plplotc module. This user-friendly version puts in required python argument list variations for plcont, etc. Note that the python modules have been renamed from pl and pyqt_pl to plplot and plplot_widget. There is a long tradition in python of having meaningful module names so that is why I wanted plplot in both names. Also, I replaced pyqt with widget (in different order) because the widget support functions in that module can be used not only by pyqt but also apparently by the Tkinter widget. I decided on this new naming after some private discussion with Geoffrey. The change will undoubtedly be annoying to our python users, but I thought so much else was being changed at this time in the way the plplot modules are generated, that it was a good opportunity to change the names as well. There are a lot of minor issues I still have to clean up such as completing the documentation strings, implementing some more user-friendly variations in plplot.py, making sure the installed versions (as opposed to test versions in plplot/tmp) work, etc. Also, I have left plplot/sys/win32/msdev/ completely untouched so there is undoubtedly work to do there to adjust to the new module names and swig generation approach. However, if Olof et al have any trouble with this they should consult with Gary because he got all this working (although without name changes yet, and apparently handling things somewhat differently than in plplot/sys/win32/msdev) for his own windows environment before he donated the software to us. Despite these minor issues I have discussed, the Unix/Linux/MacOS X build of the python modules in plplot/tmp should be in good shape both for single and double precision, and I invite you to give it a test drive. Alan email: ir...@be... phone: 250-727-2902 FAX: 250-721-7715 snail-mail: Dr. Alan W. Irwin Department of Physics and Astronomy, University of Victoria, P.O. Box 3055, Victoria, British Columbia, Canada, V8W 3P6 __________________________ Linux-powered astrophysics __________________________ |