Changeset 245
- Timestamp:
- 05/26/10 08:23:10 (6 years ago)
- Location:
- mystic
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
mystic/examples/test_mogi.py
r117 r245 115 115 desol, dstepmon = de_solve() 116 116 print "desol: ", desol 117 print "dstepmon 10: ", dstepmon.x[50]118 print "dstepmon 20: ", dstepmon.x[100]117 print "dstepmon 50: ", dstepmon.x[50] 118 print "dstepmon 100: ", dstepmon.x[100] 119 119 # 120 120 # this will try to use nelder_mean from a relatively "near by" point (very sensitive) -
mystic/mystic/tools.py
r242 r245 133 133 134 134 def __call__(self, x, y): 135 from numpy import ndarray 136 if isinstance(x,ndarray): x = list(x) 135 137 self._x.append(x) 136 138 self._y.append(y) … … 154 156 import numpy 155 157 def __init__(self, interval = 10, xinterval = numpy.inf): 156 Sow.__init__(self) 158 #Sow.__init__(self) 159 super(VerboseSow,self).__init__() 157 160 self._step = 0 158 161 self._yinterval = interval … … 161 164 def __call__(self, x, y): 162 165 from numpy import ndarray 163 Sow.__call__(self, x, y) 166 #Sow.__call__(self, x, y) 167 super(VerboseSow,self).__call__(x, y) 164 168 if isinstance(y,(list,ndarray)): 165 169 y = y[0] #XXX: get the "best" fit... which should be in y[0] … … 183 187 def __init__(self, interval=1, filename='log.txt', new=False): 184 188 import datetime 185 Sow.__init__(self) 189 #Sow.__init__(self) 190 super(LoggingSow,self).__init__() 186 191 self._filename = filename 187 192 self._step = 0 … … 198 203 self._file = open(self._filename,'a') 199 204 from numpy import ndarray 200 Sow.__call__(self, x, y) 205 #Sow.__call__(self, x, y) 206 super(LoggingSow,self).__call__(x, y) 201 207 if isinstance(y,(list,ndarray)): 202 208 y = y[0] #XXX: get the "best" fit... which should be in y[0]
Note: See TracChangeset
for help on using the changeset viewer.