From: Jonathan B. <jbr...@ea...> - 2006-10-07 21:47:32
|
On Fri, 2006-10-06 at 12:40 -0600, Bruce Sherwood wrote: > Questions have been asked about Visual for Python 2.5. A significant > hurdle to overcome is that there is not and will not be a version of > Numeric for Python 2.5 (the last to be made was for Python 2.4). Its > successor Numarray does exist for Python 2.5 but is likely to be the > last, as the download instructions say "Use Numpy!" The last time that I looked, the Numpy documentation was only available for a fee. That is why Visual was not extended to support it last summer. At any rate, the person(s) who decide to add support for Numpy to VPython should see below. > Thanks to Jonathan > Brandmeyer's work, Visual can be compiled for Numarray, but some > existing VPython programs that used explicit Numeric capabilities may > break due to some incompatibilities between Numeric and Numarray. > > The right thing to do is to revise Visual to use Numpy, which is the > designated to-be-supported replacement for both Numeric and Numarray. I > do not know how much work will be required to do this. The revision effort should not be too difficult, as there is an abstraction layer for Numeric/Numarray in VPython. Basically, at startup-time, a set of function pointers are initialized that refer to either the Numarray or Numeric implementations. Additionally, Boost.Python support for the two libs is selected at run-time. The affected files are: VPython 3.x: src/num_util_impl_numeric.cpp src/num_util_impl_numarray.cpp src/num_util.cpp include/num_util_impl.hpp include/num_util.hpp The VPython 4.x files are setup in exactly the same way, except that they are found in src/python and include/python. See also site-packages/visual/array_backend.py in both versions, although I think that there is a cleaner way to go about what this file does. Lastly, there are some configure script elements that would need to be updated in acinclude.m4 (specifically, VISUAL_NUMERICLIBS). HTH, -Jonathan |