[Scipy-svn] r2277 - trunk/Lib/sandbox/pyem/pyem

scipy-svn at scipy.org scipy-svn at scipy.org
Thu Oct 12 08:47:29 CDT 2006


Author: cdavid
Date: 2006-10-12 08:47:25 -0500 (Thu, 12 Oct 2006)
New Revision: 2277

Modified:
   trunk/Lib/sandbox/pyem/pyem/kmean.py
Log:
[pyem @ david at ar.media.kyoto-u.ac.jp-20060824111227-8ef66c985049372c]
revert to custom kmean
David Cournapeau <david at ar.media.kyoto-u.ac.jp> | 2006-08-24 20:12:27 +0900 (Thu, 24 Aug 2006)

Modified: trunk/Lib/sandbox/pyem/pyem/kmean.py
===================================================================
--- trunk/Lib/sandbox/pyem/pyem/kmean.py	2006-10-12 13:47:08 UTC (rev 2276)
+++ trunk/Lib/sandbox/pyem/pyem/kmean.py	2006-10-12 13:47:25 UTC (rev 2277)
@@ -1,5 +1,5 @@
 # /usr/bin/python
-# Last Change: Tue Aug 22 10:00 PM 2006 J
+# Last Change: Thu Aug 24 08:00 PM 2006 J
 
 import numpy as N
 
@@ -47,21 +47,21 @@
 # Try to import pyrex function for vector quantization. If not available,
 # falls back on pure python implementation.
 #%KMEANIMPORT%
+#try:
+#    from scipy.cluster.vq import kmeans as kmean
+#except ImportError:
+#    try:
+#        from c_gmm import _vq
+#    except:
+#        print """c_gmm._vq not found, using pure python implementation instead. 
+#        Kmean will be REALLY slow"""
+#        _vq = _py_vq
 try:
-    from scipy.cluster.vq import kmeans as kmean
-except ImportError:
-    try:
-        from c_gmm import _vq
-    except:
-        print """c_gmm._vq not found, using pure python implementation instead. 
-        Kmean will be REALLY slow"""
-        _vq = _py_vq
-#try:
-#    from c_gmm import _vq
-#except:
-#    print """c_gmm._vq not found, using pure python implementation instead. 
-#    Kmean will be REALLY slow"""
-#    _vq = _py_vq
+    from c_gmm import _vq
+except:
+    print """c_gmm._vq not found, using pure python implementation instead. 
+    Kmean will be REALLY slow"""
+    _vq = _py_vq
 
 # Test functions usable for now
 def test_kmean():



More information about the Scipy-svn mailing list