changeset 829:3f44379177b2

More descriptive error message when fpconst is missing.
author Pascal Lamblin <lamblinp@iro.umontreal.ca>
date Wed, 07 Oct 2009 11:17:49 -0400
parents 9945cd79fe79
children 0ba62c55d59f
files pylearn/datasets/MNIST.py pylearn/io/pmat.py
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/datasets/MNIST.py	Wed Sep 30 17:15:01 2009 -0400
+++ b/pylearn/datasets/MNIST.py	Wed Oct 07 11:17:49 2009 -0400
@@ -53,11 +53,11 @@
 def full():
     return train_valid_test()
 
-#usefull for test, keep it
+#useful for test, keep it
 def first_10():
     return train_valid_test(ntrain=10, nvalid=10, ntest=10)
 
-#usefull for test, keep it
+#useful for test, keep it
 def first_100():
     return train_valid_test(ntrain=100, nvalid=100, ntest=100)
 
--- a/pylearn/io/pmat.py	Wed Sep 30 17:15:01 2009 -0400
+++ b/pylearn/io/pmat.py	Wed Oct 07 11:17:49 2009 -0400
@@ -36,7 +36,12 @@
 
 #import numarray, sys, os, os.path
 import numpy.numarray, sys, os, os.path
-import fpconst
+try:
+    import fpconst
+except ImportError:
+    print 'Python library fpconst is needed but not installed,'
+    print 'please install it using your favorite package manager.'
+    raise
 
 def array_columns( a, cols ):
     indices = None