Mercurial > pylearn
changeset 424:0231eeac11c9
Fixed incorrect handling of slice column specifications in ArrayDataSet
author | Yoshua Bengio <bengioy@iro.umontreal.ca> |
---|---|
date | Sat, 19 Jul 2008 14:26:24 -0400 |
parents | 3da4961cc80b |
children | e2b46a8f2b7b |
files | dataset.py |
diffstat | 1 files changed, 4 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/dataset.py Sat Jul 19 14:18:35 2008 -0400 +++ b/dataset.py Sat Jul 19 14:26:24 2008 -0400 @@ -1227,13 +1227,12 @@ else: self.fields_columns[fieldname]=fieldcolumns elif type(fieldcolumns) is slice: - start,step=None,None - if not fieldcolumns.start: + start,step=fieldcolumns.start,fieldcolumns.step + if not start: start=0 - if not fieldcolumns.step: + if not step: step=1 - if start or step: - self.fields_columns[fieldname]=slice(start,fieldcolumns.stop,step) + self.fields_columns[fieldname]=slice(start,fieldcolumns.stop,step) elif hasattr(fieldcolumns,"__iter__"): # something like a list for i in fieldcolumns: assert i>=0 and i<data_array.shape[1]