changeset 900:f36d68b65f2c

backport to python 2.4
author Frederic Bastien <nouiz@nouiz.org>
date Wed, 24 Feb 2010 13:36:01 -0500
parents 2e87264493ef
children a88c1746b068
files pylearn/algorithms/stopper.py pylearn/datasets/shapeset1.py pylearn/version.py
diffstat 3 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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)
--- 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