# HG changeset patch # User James Bergstra # Date 1211497671 14400 # Node ID 4b7e89b75e2be3ffc04c48e0fef9764d1f9fa1e8 # Parent 6fa8fbb0c3f68b2ba6ccc7fc18f2ab9ff4e26b6f Modified ArrayDataSet's handling of column fields. Previously, if a fieldname were associated with an integer column index (by opposition to a column range or slice) then it would be returned as a Nx1 matrix. Now if a fieldname is associated with an integer column index, then it will make a field which is a vector of length N. The old behaviour can still be achieved by associating a fieldname with the slice(col, col+1). diff -r 6fa8fbb0c3f6 -r 4b7e89b75e2b dataset.py --- a/dataset.py Thu May 22 17:41:14 2008 -0400 +++ b/dataset.py Thu May 22 19:07:51 2008 -0400 @@ -245,7 +245,8 @@ if n_batches is not None: ds_nbatches = min(n_batches,ds_nbatches) if fieldnames: - assert dataset.hasFields(*fieldnames) + if not dataset.hasFields(*fieldnames): + raise ValueError('field not present', fieldnames) else: self.fieldnames=dataset.fieldNames() self.iterator = self.dataset.minibatches_nowrap(self.fieldnames,self.minibatch_size, @@ -969,7 +970,16 @@ for fieldname, fieldcolumns in self.fields_columns.items(): if type(fieldcolumns) is int: assert fieldcolumns>=0 and fieldcolumns