[Scipy-svn] r2410 - trunk/Lib/sandbox/models

scipy-svn at scipy.org scipy-svn at scipy.org
Thu Dec 14 11:29:37 EST 2006


Author: jonathan.taylor
Date: 2006-12-14 10:29:35 -0600 (Thu, 14 Dec 2006)
New Revision: 2410

Modified:
   trunk/Lib/sandbox/models/formula.py
Log:
fixed _get_namespace to allow recarrays to be used


Modified: trunk/Lib/sandbox/models/formula.py
===================================================================
--- trunk/Lib/sandbox/models/formula.py	2006-12-13 22:04:51 UTC (rev 2409)
+++ trunk/Lib/sandbox/models/formula.py	2006-12-14 16:29:35 UTC (rev 2410)
@@ -53,7 +53,11 @@
 
     # Namespace in which self.name will be looked up in, if needed
 
-    def _get_namespace(self):  return self.__namespace or default_namespace
+    def _get_namespace(self): 
+	if isinstance(self.__namespace, N.ndarray): 
+	    return self.__namespace 
+	else: return self.__namespace or default_namespace
+
     def _set_namespace(self, value):  self.__namespace = value
     def _del_namespace(self): del self.__namespace
     namespace = property(_get_namespace, _set_namespace, _del_namespace)




More information about the Scipy-svn mailing list