diff dataset.py @ 142:ad144fa72bf5

Automated merge with ssh://p-omega1@lgcm.iro.umontreal.ca/tlearn
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Mon, 12 May 2008 14:15:16 -0400
parents 3f4e5c9bdc5e f5f235bebee4
children ceae4de18981
line wrap: on
line diff
--- a/dataset.py	Fri May 09 17:38:57 2008 -0400
+++ b/dataset.py	Mon May 12 14:15:16 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)