[visionegg] Numeric inconsistancies

  • From: Mark Halko <mhalko@xxxxxx>
  • To: visionegg@xxxxxxxxxxxxx
  • Date: Tue, 6 Sep 2005 14:48:29 -0400

Hi Andrew -

I had problems with Numeric 24.0b2 and visionegg.

Creating a mask results in an integer error:
>>> mask = Mask2D(function='circle',
... radius_parameter=300,
... num_samples=(512,512))
Traceback (most recent call last):
File "<stdin>", line 3, in ?
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/VisionEgg/Textures.py", line 1234, in __init__
xx = Numeric.outerproduct(Numeric.ones((1.0,cp.num_samples[1])),
File "/Library/Python/2.3/Numeric/Numeric.py", line 581, in ones
a=zeros(shape, typecode, savespace)
TypeError: an integer is required


I think the problem is that Numeric.ones is not supposed to accept a float as a shape argument, however, previous versions would accept this behavior:
http://sourceforge.net/mailarchive/message.php?msg_id=11551712


replacing offending lines in Textures.py containing the string:
Numeric.ones((1.0,cp.num_samples[0]))
with
Numeric.ones((1, cp.num_samples[0]), 'f')

should make the code behave as is expected on all versions of Numeric.

I'm not sure about the rest of visionegg - there may be more code that does this.

Mark


====================================== The Vision Egg mailing list Archives: //www.freelists.org/archives/visionegg Website: http://www.visionegg.org/mailinglist.html

Other related posts:

  • » [visionegg] Numeric inconsistancies