# HG changeset patch # User Frederic Bastien # Date 1267036561 18000 # Node ID f36d68b65f2ce1a28ae31a0cf9e6625c78611638 # Parent 2e87264493efbbfead8231442266a8008c05dcec backport to python 2.4 diff -r 2e87264493ef -r f36d68b65f2c pylearn/algorithms/stopper.py --- a/pylearn/algorithms/stopper.py Thu Feb 11 09:44:34 2010 -0500 +++ b/pylearn/algorithms/stopper.py Wed Feb 24 13:36:01 2010 -0500 @@ -100,7 +100,9 @@ starting = self.iter < self.initial_wait waiting = self.iter < (self.patience * self.best_iter) - times_up = (time.time() - self.start_time) > self.hard_limit_seconds if self.hard_limit_seconds != None else False + if self.hard_limit_seconds != None: + times_up = (time.time() - self.start_time) > self.hard_limit_seconds + else: times_up = False if (starting or waiting) and not times_up: # continue to iterate self.iter += 1 diff -r 2e87264493ef -r f36d68b65f2c pylearn/datasets/shapeset1.py --- a/pylearn/datasets/shapeset1.py Thu Feb 11 09:44:34 2010 -0500 +++ b/pylearn/datasets/shapeset1.py Wed Feb 24 13:36:01 2010 -0500 @@ -2,14 +2,12 @@ Routines to load/access Shapeset1 """ -from __future__ import absolute_import - import os import numpy -from ..io.amat import AMat -from .config import data_root -from .dataset import Dataset +from pylearn.io.amat import AMat +from pylearn.datasets.config import data_root +from pylearn.datasets.dataset import Dataset def _head(path, n): dat = AMat(path=path, head=n) diff -r 2e87264493ef -r f36d68b65f2c pylearn/version.py --- a/pylearn/version.py Thu Feb 11 09:44:34 2010 -0500 +++ b/pylearn/version.py Wed Feb 24 13:36:01 2010 -0500 @@ -154,8 +154,10 @@ raise OSError('hg returned %i, maybe %s is not under hg control?', (id_proc.returncode, dirname)) - care_about = (lambda some_file : True) if filenames is None \ - else (lambda some_file : some_file in filenames) + if filenames is None: + care_about = (lambda some_file : True) + else: + care_about = (lambda some_file : some_file in filenames) # parse status codes for what we care about care_about_mod = False