problem calling SD.SDim.setname in pyhdf
Hi, I recently upgraded pyhdf from 0.7-3 to 0.8-2, and have noticed some problems with the SD.SDim interface. Specifically, the short test code attached works fine with version 0.7-3 and fails with version 0.8-2 when it's trying to assign a name to the dimension. I get the following error (below). Does anybody else have similar problems while trying to attach a name to an SDim object in the most recent version of pyhdf? I'm running on a Linux box, python version 2.5. etting Dimension: Dimension0 Traceback (most recent call last): File "./Test_pyhdf.py", line 35, in <module> main() File "./Test_pyhdf.py", line 27, in main dim.setname(dname) File "/usr/lib64/python2.5/site-packages/pyhdf/SD.py", line 2856, in setname _checkErr('setname', status, 'cannot execute') File "/usr/lib64/python2.5/site-packages/pyhdf/error.py", line 24, in _checkErr raise HDF4Error, str pyhdf.error.HDF4Error: ('s', 'e', 't', 'n', 'a', 'm', 'e', ' ', ':', ' ', 'c', 'a', 'n', 'n', 'o', 't', ' ', 'e', 'x', 'e', 'c', 'u', 't', 'e') Thanks for any help, Catherine #! /usr/bin/env python from pyhdf import HDF from pyhdf import SD def main(): rank = (10,20) flhdf = SD.SD("Test_pyhdf.hdf",HDF.HC.CREATE|HDF.HC.WRITE| HDF.HC.TRUNC) sds = flhdf.create("Test SDS",HDF.HC.INT32,rank) for idim in range(0,2): dim = sds.dim(idim) dname = "Dimension" + str(idim) print "Setting Dimension: ",dname dtype = HDF.HC.FLOAT32 scale = [i for i in range(0,rank[idim])] dim.setname(dname) <----- CRASHES ON THIS LINE dim.units = "None" dim.setscale(dtype, scale) sds.endaccess() flhdf.end() if __name__ == "__main__": main()
On Mon, Sep 29, 2008 at 17:39, Catherine Moroney
Hi,
I recently upgraded pyhdf from 0.7-3 to 0.8-2, and have noticed some problems with the SD.SDim interface.
Specifically, the short test code attached works fine with version 0.7-3 and fails with version 0.8-2 when it's trying to assign a name to the dimension.
I get the following error (below). Does anybody else have similar problems while trying to attach a name to an SDim object in the most recent version of pyhdf?
I'm running on a Linux box, python version 2.5.
etting Dimension: Dimension0 Traceback (most recent call last): File "./Test_pyhdf.py", line 35, in <module> main() File "./Test_pyhdf.py", line 27, in main dim.setname(dname) File "/usr/lib64/python2.5/site-packages/pyhdf/SD.py", line 2856, in setname _checkErr('setname', status, 'cannot execute') File "/usr/lib64/python2.5/site-packages/pyhdf/error.py", line 24, in _checkErr raise HDF4Error, str pyhdf.error.HDF4Error: ('s', 'e', 't', 'n', 'a', 'm', 'e', ' ', ':', ' ', 'c', 'a', 'n', 'n', 'o', 't', ' ', 'e', 'x', 'e', 'c', 'u', 't', 'e')
We have noticed the same thing on 64-bit Linux platforms. We are currently tracking this bug here: https://svn.enthought.com/epd/ticket/357 Please report pyhdf problems to the enthought-dev mailing list, rather than here (as I am probably the responsible party). https://mail.enthought.com/mailman/listinfo/enthought-dev Unfortunately, I don't know what's wrong at the moment. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
participants (2)
-
Catherine Moroney
-
Robert Kern