comparison dataset.py @ 274:ed70580f2324

bugfix in FieldSubsetDataSet
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Thu, 05 Jun 2008 13:46:26 -0400
parents fa8abc813bd2
children 9b533cc7874a
comparison
equal deleted inserted replaced
273:fa8abc813bd2 274:ed70580f2324
619 """ 619 """
620 def __init__(self,dataset,fieldnames): 620 def __init__(self,dataset,fieldnames):
621 original_dataset=dataset 621 original_dataset=dataset
622 if not fieldnames: 622 if not fieldnames:
623 fieldnames=dataset.fieldNames() 623 fieldnames=dataset.fieldNames()
624 elif not fieldnames==dataset.fieldNames(): 624 elif not list(fieldnames)==list(dataset.fieldNames()):
625 #we must cast to list, othersize('x','y')!=['x','y']
625 dataset = FieldsSubsetDataSet(dataset,fieldnames) 626 dataset = FieldsSubsetDataSet(dataset,fieldnames)
626 assert dataset.hasFields(*fieldnames) 627 assert dataset.hasFields(*fieldnames)
627 self.dataset=dataset 628 self.dataset=dataset
628 629
629 if isinstance(dataset,MinibatchDataSet): 630 if isinstance(dataset,MinibatchDataSet):