[Gdal-dev] NumPy supported in 1.4.0?

Frank Warmerdam warmerdam at pobox.com
Mon Feb 12 20:12:45 EST 2007

William Kyngesburye wrote:
> Sorry to keep replying to myself.
> I just noticed that the numpy failure is for the old bindings.  The 
> numpy_rw_ng.py tests succeeded.
> Is there a way to check for new/old bindings without failing a test?  
> Otherwise one gets a false sense of "something's wrong!".
> On Feb 12, 2007, at 5:01 PM, William Kyngesburye wrote:
>> On Feb 12, 2007, at 4:42 PM, William Kyngesburye wrote:
>> Running tests from gcore/numpy_rw.py
>>   TEST: numpy_rw_1 ... fail (blowup)
>> Traceback (most recent call last):
>>   File "pymod/gdaltest.py", line 170, in run_tests
>>     result = func()
>>   File "./numpy_rw.py", line 68, in numpy_rw_1
>>     _gdal.GDALRegister_NUMPY()
>> AttributeError: 'module' object has no attribute 'GDALRegister_NUMPY'
>>   TEST: numpy_rw_2 ... skip
>>   TEST: numpy_rw_cleanup ... success


numpy_rw.py already tries to skip the tests if it thinks the old-gen
bindings aren't supported.  But I think the test is incomplete.  Now it does:

     gdaltest.numpy_drv = None
         import Numeric
         import gdalnumeric
         return 'skip'

     import _gdal

Perhaps the _gdal.GDALRegister_NUMPY() should also be inside the
try block.  Hmm, I'm really not sure why this script is calling
gdal.AllRegister() or _gdal.GDALRegister_NUMPY() for that matter.
It seems like importing gdal should already have ensured this was

Hmm, Howard?  Can we merge numpy_rw.py and numpy_rw_ng.py and make sure
they are pretty bulletproof in old-style and new style bindings?

I don't see these problems, but it turns out it is because I don't
have numpy or Numeric installed.

Best regards,
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org

More information about the Gdal-dev mailing list