[Scipy-svn] r2336 - trunk/Lib/sandbox/models
scipy-svn at scipy.org
scipy-svn at scipy.org
Tue Nov 28 19:04:04 CST 2006
Author: timl
Date: 2006-11-28 19:03:53 -0600 (Tue, 28 Nov 2006)
New Revision: 2336
Modified:
trunk/Lib/sandbox/models/contrast.py
trunk/Lib/sandbox/models/cox.py
trunk/Lib/sandbox/models/formula.py
trunk/Lib/sandbox/models/mixed.py
Log:
fix name errors
Modified: trunk/Lib/sandbox/models/contrast.py
===================================================================
--- trunk/Lib/sandbox/models/contrast.py 2006-11-29 00:42:04 UTC (rev 2335)
+++ trunk/Lib/sandbox/models/contrast.py 2006-11-29 01:03:53 UTC (rev 2336)
@@ -1,8 +1,6 @@
import numpy as N
from numpy.linalg import pinv
from scipy.sandbox.models import utils
-from scipy.sandbox.models.formula import formula as formula_class
-from scipy.sandbox.models.formula import term as term_class
class ContrastResults:
"""
Modified: trunk/Lib/sandbox/models/cox.py
===================================================================
--- trunk/Lib/sandbox/models/cox.py 2006-11-29 00:42:04 UTC (rev 2335)
+++ trunk/Lib/sandbox/models/cox.py 2006-11-29 01:03:53 UTC (rev 2336)
@@ -203,8 +203,8 @@
subjects[i].X = X[i]
import formula as F
- x = F.Quantitative('X')
- f = F.Formula(x)
+ x = F.quantitative('X')
+ f = F.formula(x)
c = coxph(subjects, f)
Modified: trunk/Lib/sandbox/models/formula.py
===================================================================
--- trunk/Lib/sandbox/models/formula.py 2006-11-29 00:42:04 UTC (rev 2335)
+++ trunk/Lib/sandbox/models/formula.py 2006-11-29 01:03:53 UTC (rev 2336)
@@ -270,7 +270,7 @@
"""
return self.transform(term.__call__(self, *args, **kw))
-class formula:
+class formula(object):
"""
@@ -367,10 +367,10 @@
n = allvals[1].shape[1]
allvals[interceptindex] = N.ones((1,n), N.float64)
allvals = N.concatenate(allvals)
- elif nrow <= 1:
+ elif nrow <= 1: # FIXME: nrow is undefined here
raise ValueError, 'with only intercept in formula, keyword \'nrow\' argument needed'
else:
- allvals = I(nrow=nrow)
+ allvals = I(nrow=nrow) # ... and here
allvals.shape = (1,) + allvals.shape
return allvals
Modified: trunk/Lib/sandbox/models/mixed.py
===================================================================
--- trunk/Lib/sandbox/models/mixed.py 2006-11-29 00:42:04 UTC (rev 2335)
+++ trunk/Lib/sandbox/models/mixed.py 2006-11-29 01:03:53 UTC (rev 2336)
@@ -1,6 +1,6 @@
import numpy as N
import numpy.linalg as L
-from scipy.sandbox.models.formula import Formula, I
+from scipy.sandbox.models.formula import formula, I
class Unit:
@@ -148,9 +148,9 @@
self.units = units
self.m = len(self.units)
- self.fixed = Formula(fixed)
- self.random = Formula(random)
- self.response = Formula(response)
+ self.fixed = formula(fixed)
+ self.random = formula(random)
+ self.response = formula(response)
self.N = 0
for unit in self.units:
@@ -315,9 +315,9 @@
n = 3
import formula
- fixed = formula.Term('f')
- random = formula.Term('r')
- response = formula.Term('y')
+ fixed = formula.term('f')
+ random = formula.term('r')
+ response = formula.term('y')
for i in range(nsubj):
d = R.standard_normal()
More information about the Scipy-svn
mailing list