diff dataset.py @ 144:ceae4de18981

Automated merge with ssh://p-omega1@lgcm.iro.umontreal.ca/tlearn
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Mon, 12 May 2008 15:08:18 -0400
parents 0d8e721cc63c ad144fa72bf5
children 8173e196e291 9abd19af822e
line wrap: on
line diff
--- a/dataset.py	Mon May 12 14:30:21 2008 -0400
+++ b/dataset.py	Mon May 12 15:08:18 2008 -0400
@@ -770,16 +770,19 @@
                 return self
             def next(self):
                 # concatenate all the fields of the minibatches
-                return reduce(LookupList.__add__,[iterator.next() for iterator in self.iterators])
+                l=LookupList()
+                for iter in self.iterators:
+                    l.append_lookuplist(iter.next())
+                return l
                                      
         assert self.hasFields(*fieldnames)
         # find out which underlying datasets are necessary to service the required fields
         # and construct corresponding minibatch iterators
-        if fieldnames:
+        if fieldnames and fieldnames!=self.fieldNames():
             datasets=set([])
             fields_in_dataset=dict([(dataset,[]) for dataset in datasets])
             for fieldname in fieldnames:
-                dataset=self.datasets[self.fieldnames2dataset[fieldname]]
+                dataset=self.datasets[self.fieldname2dataset[fieldname]]
                 datasets.add(dataset)
                 fields_in_dataset[dataset].append(fieldname)
             datasets=list(datasets)