From: Francesc A. <fa...@ca...> - 2005-01-09 19:21:29
|
Yes, you have detected a bug in PyTables. You can solve it by replacing the function H5TB_find_field in src/H5TB.c by the next one: int H5TB_find_field( const char *field, const char *field_list ) { const char *start =3D field_list;=20 const char *end;=20 while ( (end =3D strstr( start, "," )) !=3D 0 ) {=20 if ( strncmp(start,field,end-start) =3D=3D 0 ) return 1;=20 start =3D end + 1;=20 }=20 if ( strcmp( start, field ) =3D=3D 0 ) return 1;=20 return -1; =20 } =20 I'll commit the necessary changes to the software repository soon. Cheers, A Divendres 07 Gener 2005 09:58, russ va escriure: > Hello, I'm working with pytables 0.9.1 on windows 2000 and seem to have=20 > discovered a bug somewhere in the works. Essentially I have a table=20 > with two columns, "mmid" and "mmidn", and pytables can't read the=20 > "mmidn" column. Following is a short program that demonstrates the=20 > problem, and following that is the output of the program. The problem=20 > seems to be in the naming; changing "mmidn" to "abcd" fixes the=20 > problem. Similarly, changing the pair to "abc" and "abcd" recreates the= =20 > problem. Any help would be appreciated. > Thanks, -Russ > ru...@ag... > -------------------------------------------------------------------------= =2D------ > import sys,os > import tables as hdf >=20 > class Consolidatedtable(hdf.IsDescription): > mmid =3D hdf.Int32Col(pos=3D4) > mmidn =3D hdf.Int32Col(pos=3D5) > fname=3D'tmp.h5' > print 'pytables version:', hdf.__version__ >=20 > print 'writing', fname > h5 =3D hdf.openFile(fname, mode=3D'w', title=3D'bwdata') > t=3Dh5.createTable('/','q',Consolidatedtable,'data',expectedrows=3D10000) > r=3Dt.row > r['mmid']=3D0 > r['mmidn']=3D0 > r.append() > h5.close() >=20 >=20 > print 'reading' > h5=3Dhdf.openFile(fname) > print 'this works:', h5.root.q['mmid'] > print 'this does not:', h5.root.q['mmidn'] >=20 >=20 > -------------------------------------------------------------------------= =2D------ > program output: >=20 > $ /d/py/test_mmidn.py > pytables version: 0.9.1 > writing tmp.h5 > reading > this works: [0] > this does not:HDF5-DIAG: Error detected in HDF5 library version:=20 > 1.6.3-patch thr > ead 0. Back trace follows. > #000: D:\hdf5\src\H5Tcompound.c line 327 in H5Tinsert(): unable to=20 > insert memb > er > major(13): Datatype interface > minor(45): Unable to insert object > #001: D:\hdf5\src\H5Tcompound.c line 418 in H5T_insert(): member=20 > overlaps with > another member > major(13): Datatype interface > minor(45): Unable to insert object >=20 > Traceback (most recent call last): > File "d:/util/mypython.py", line 15, in ? > execfile(sys.argv[0]) > File "d:/py/test_mmidn.py", line 24, in ? > print 'this does not:', h5.root.q['mmidn'] > File "D:\Python23\lib\site-packages\tables\Table.py", line 778, in=20 > __getitem__ >=20 > return self.read(field=3Dkey) > File "D:\Python23\lib\site-packages\tables\Table.py", line 592, in read > return self._read(start, stop, step, field, coords) > File "D:\Python23\lib\site-packages\tables\Table.py", line 731, in _read > self._read_field_name(result, start, stop, step, field) > File "hdf5Extension.pyx", line 1831, in=20 > hdf5Extension.Table._read_field_name > RuntimeError: Problems reading table column. >=20 >=20 >=20 > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Pytables-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pytables-users >=20 =2D-=20 =46rancesc Altet =A0 >qo< =A0 http://www.carabos.com/ C=E1rabos Coop. V. =A0 V =A0V =A0 Enjoy Data =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "" |