From: Ashley W. <ash...@gm...> - 2005-10-06 00:55:27
|
Hi, While testing pytables-1.2-pre1 (also tested 20051005 snapshot) on win32 with some older HDF5 files I encountered a problem with retrieving a single column from the table. Using: values = table.cols._f_col('somecolumn') returned the *next* column after 'somecolumn'. I tracked the problem down to the Row._fillCol method in TableExtension.pyx, and the problem was fixed by the patch at the end. It looks like something is messing up the _fields dictionary on the NestedRecArray -- I didn't delve any deeper trying to find out *why* this correction works. I was using: Pytables-1.2-pre1 numarray-1.3.3 Numeric-23.8 HDF5-1.6.4 Python-2.3.5 This problem did not occur on MacOSX. The fix: TableExtension.pyx 984,989c984,990 < if field: < # If field is not None, select it < fields = self.rbufRA._fields[field] < else: < # if don't, select all fields < fields = self.rbufRA --- > #if field: > # # If field is not None, select it > # fields = self.rbufRA._fields[field] > #else: > # # if don't, select all fields > # fields = self.rbufRA > fields = self.rbufRA 1006c1007,1010 < result[startr:stopr] = fields[istartb:istopb:istep] --- > if field: > result[startr:stopr] = fields.field(field) [istartb:istopb:istep] > else: > result[startr:stopr] = fields[istartb:istopb:istep] Cheers, Ashley PS. UCL is working on OSX: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =-=-=-= PyTables version: 1.2-pre1-1 HDF5 version: 1.6.4 numarray version: 1.3.3 Zlib version: 1.2.2 LZO version: 1.08 (Jul 12 2002) UCL version: 1.03 (Jul 20 2004) BZIP2 version: 1.0.2 (30-Dec-2001) Python version: 2.3.5 (#1, Mar 20 2005, 20:38:20) [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] Platform: darwin-Power Macintosh Byte-ordering: big -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =-=-=-= Performing the complete test suite! -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =-=-=-= Numeric (version 23.3) is present. Adding the Numeric test suite. test01_readTable (test_backcompat.Table1_0UCL) ... ok test01_readTable (test_backcompat.Table2_0UCL) ... ok test01_readTable (test_backcompat.Table2_1UCL) ... ok ... more ok's test03_setitemCArray (test_carray.UCLShuffleTestCase) ... ok test01_readVLArray (test_vlarray.UCLComprTestCase) ... ok test02_appendVLArray (test_vlarray.UCLComprTestCase) ... ok |