Changeset 466


Ignore:
Timestamp:
07/02/11 20:41:02 (5 years ago)
Author:
mmckerns
Message:

moved monitors from mystic.tools to mystic.monitors

Location:
mystic
Files:
1 added
49 edited

Legend:

Unmodified
Added
Removed
  • mystic/_math/measures.py

    r465 r466  
    238238    from mystic.termination import VTR 
    239239    from mystic.strategy import Best1Exp 
    240     from mystic.tools import random_seed, VerboseSow, Sow 
     240    from mystic.monitors import VerboseMonitor, Monitor 
     241    from mystic.tools import random_seed 
    241242    if debug: random_seed(123) 
    242     evalmon = Sow();  stepmon = Sow() 
    243     if debug: stepmon = VerboseSow(10) 
     243    evalmon = Monitor();  stepmon = Monitor() 
     244    if debug: stepmon = VerboseMonitor(10) 
    244245 
    245246    ndim = len(lb) 
  • mystic/examples/NOTES

    r133 r466  
    115115- MAX_GENERATIONS is maximum optimization iterations 
    116116#----------------------------------------------------------------------------- 
    117 - VerboseSow logs/prints "goodness of fit" and "best solution" at each step 
     117- VerboseMonitor logs/prints "goodness of fit" and "best solution" at each step 
    118118- minrange/maxrange provide box constraints (for parameters a,b,c) 
    119119- SetRandomInitialPoints chooses an initial solution within box constraints 
     
    127127    solver.enable_signal_handler() 
    128128 
    129     stepmon = VerboseSow(10,50) 
     129    stepmon = VerboseMonitor(10,50) 
    130130    minrange = [-100., -100., -100.]; maxrange = [100., 100., 100.]; 
    131131    solver.SetRandomInitialPoints(min = minrange, max = maxrange) 
  • mystic/examples/TEST_ffitPP.py

    r465 r466  
    2929    solver.Solve(ChebyshevCost, termination=VTR(0.01), strategy=strategy, \ 
    3030                 CrossProbability=1.0, ScalingFactor=0.9 , \ 
    31                  StepMonitor=VerboseSow(30), sigint_callback=plot_solution) 
     31                 StepMonitor=VerboseMonitor(30), sigint_callback=plot_solution) 
    3232 
    3333    solution = solver.Solution() 
  • mystic/examples/TEST_ffitPP_b.py

    r465 r466  
    5757    solver.Solve(ChebyshevCost, termination=VTR(0.01), strategy=strategy, \ 
    5858                 CrossProbability=1.0, ScalingFactor=0.9 , \ 
    59                  StepMonitor=VerboseSow(30), sigint_callback=plot_solution) 
     59                 StepMonitor=VerboseMonitor(30), sigint_callback=plot_solution) 
    6060 
    6161    solution = solver.Solution() 
  • mystic/examples/buckshot_example06.py

    r465 r466  
    2424from mystic.termination import NormalizedChangeOverGeneration as NCOG 
    2525from mystic.math import poly1d 
    26 from mystic.tools import getch, VerboseSow 
     26from mystic.monitors import VerboseMonitor 
     27from mystic.tools import getch 
    2728import pylab 
    2829pylab.ion() 
     
    6869 
    6970    # configure monitor 
    70     stepmon = VerboseSow(1) 
     71    stepmon = VerboseMonitor(1) 
    7172 
    7273    # use buckshot-Powell to solve 8th-order Chebyshev coefficients 
  • mystic/examples/example08.py

    r465 r466  
    2525from mystic.termination import VTR 
    2626from mystic.strategy import Best1Exp 
    27 from mystic.tools import getch, random_seed, VerboseSow 
     27from mystic.monitors import VerboseMonitor 
     28from mystic.tools import getch, random_seed 
    2829from mystic.math import poly1d 
    2930import pylab 
     
    6970 
    7071    # configure monitor 
    71     stepmon = VerboseSow(50) 
     72    stepmon = VerboseMonitor(50) 
    7273 
    7374    # use DE to solve 8th-order Chebyshev coefficients 
  • mystic/examples/example09.py

    r465 r466  
    2727from mystic.termination import VTR 
    2828from mystic.strategy import Best1Exp 
    29 from mystic.tools import getch, random_seed, VerboseSow 
     29from mystic.monitors import VerboseMonitor 
     30from mystic.tools import getch, random_seed 
    3031from mystic.math import poly1d 
    3132import pylab 
     
    7576 
    7677    # configure monitor 
    77     stepmon = VerboseSow(50) 
     78    stepmon = VerboseMonitor(50) 
    7879 
    7980    # use DE to solve 8th-order Chebyshev coefficients 
  • mystic/examples/example10.py

    r465 r466  
    2525from mystic.termination import VTR 
    2626from mystic.strategy import Best1Exp 
    27 from mystic.tools import getch, random_seed, VerboseSow, Sow 
     27from mystic.monitors import VerboseMonitor, Monitor 
     28from mystic.tools import getch, random_seed 
    2829from mystic.math import poly1d 
    2930import pylab 
     
    5758 
    5859    # configure monitors 
    59     stepmon = VerboseSow(50) 
    60     evalmon = Sow() 
     60    stepmon = VerboseMonitor(50) 
     61    evalmon = Monitor() 
    6162 
    6263    # use DE to solve 8th-order Chebyshev coefficients 
  • mystic/examples/example11.py

    r465 r466  
    2525# tools 
    2626from mystic.termination import CandidateRelativeTolerance as CRT 
    27 from mystic.tools import getch, random_seed, VerboseSow, Sow 
     27from mystic.monitors import VerboseMonitor, Monitor 
     28from mystic.tools import getch, random_seed 
    2829from mystic.math import poly1d 
    2930import pylab 
     
    9495 
    9596    # configure monitors 
    96     stepmon = VerboseSow(100) 
    97     evalmon = Sow() 
     97    stepmon = VerboseMonitor(100) 
     98    evalmon = Monitor() 
    9899 
    99100    # use Nelder-Mead to solve 8th-order Chebyshev coefficients 
  • mystic/examples/ezmap_desolve.py

    r465 r466  
    2929from mystic.termination import ChangeOverGeneration, VTR 
    3030from mystic.strategy import Best1Exp 
    31 from mystic.tools import VerboseSow, random_seed 
     31from mystic.monitors import VerboseMonitor 
     32from mystic.tools import random_seed 
    3233from mystic.math import poly1d 
    3334 
     
    4950        return 
    5051 
    51     psow = VerboseSow(10) 
    52     ssow = VerboseSow(10) 
     52    psow = VerboseMonitor(10) 
     53    ssow = VerboseMonitor(10) 
    5354 
    5455    random_seed(seed) 
  • mystic/examples/ezmap_desolve_rosen.py

    r465 r466  
    3030from mystic.termination import ChangeOverGeneration, VTR 
    3131from mystic.strategy import Best1Exp 
    32 from mystic.tools import VerboseSow, random_seed 
     32from mystic.monitors import VerboseMonitor 
     33from mystic.tools import random_seed 
    3334 
    3435#from raw_rosen import rosen as myCost     # ez_map needs a helper function 
     
    5354        return 
    5455 
    55     psow = VerboseSow(10) 
    56     ssow = VerboseSow(10) 
     56    psow = VerboseMonitor(10) 
     57    ssow = VerboseMonitor(10) 
    5758 
    5859    random_seed(seed) 
  • mystic/examples/lattice_example06.py

    r465 r466  
    2424from mystic.termination import NormalizedChangeOverGeneration as NCOG 
    2525from mystic.math import poly1d 
    26 from mystic.tools import getch, VerboseSow 
     26from mystic.monitors import VerboseMonitor 
     27from mystic.tools import getch 
    2728import pylab 
    2829pylab.ion() 
     
    6970 
    7071    # configure monitor 
    71     stepmon = VerboseSow(1) 
     72    stepmon = VerboseMonitor(1) 
    7273 
    7374    # use lattice-Powell to solve 8th-order Chebyshev coefficients 
  • mystic/examples/rosetta_mogi.py

    r465 r466  
    7070# --- Call to Mystic's Fmin optimizer --- 
    7171def mystic_optimize(point): 
    72     from mystic.tools import getch, Sow, random_seed, VerboseSow 
     72    from mystic.monitors import Monitor, VerboseMonitor 
     73    from mystic.tools import getch, random_seed 
    7374    random_seed(123) 
    7475    from mystic.solvers import NelderMeadSimplexSolver as fmin 
    7576    from mystic.termination import CandidateRelativeTolerance as CRT 
    76     simplex, esow = VerboseSow(50), Sow() 
     77    simplex, esow = VerboseMonitor(50), Monitor() 
    7778    solver = fmin(len(point)) 
    7879    solver.SetInitialPoints(point) 
     
    8485# --- Call to Mystic's DE optimizer --- 
    8586def mystic_optimize2(point): 
    86     from mystic.tools import getch, Sow, random_seed, VerboseSow 
     87    from mystic.monitors import Monitor, VerboseMonitor 
     88    from mystic.tools import getch, random_seed 
    8789    random_seed(123) 
    8890    from mystic.solvers import DifferentialEvolutionSolver as de 
    8991    from mystic.termination import ChangeOverGeneration as COG 
    9092    NPOP = 50 
    91     simplex, esow = VerboseSow(50), Sow() 
     93    simplex, esow = VerboseMonitor(50), Monitor() 
    9294    solver = de(len(point),NPOP) 
    9395    solver.SetInitialPoints(point) 
  • mystic/examples/rosetta_parabola.py

    r465 r466  
    5252# --- Call to Mystic --- 
    5353def mystic_optimize(point): 
    54     from mystic.tools import Sow, VerboseSow 
     54    from mystic.monitors import Monitor, VerboseMonitor 
    5555    from mystic.solvers import NelderMeadSimplexSolver as fmin 
    5656    from mystic.termination import CandidateRelativeTolerance as CRT 
    57     simplex, esow = VerboseSow(50), Sow() 
     57    simplex, esow = VerboseMonitor(50), Monitor() 
    5858    solver = fmin(len(point)) 
    5959    solver.SetInitialPoints(point) 
  • mystic/examples/test_br8.py

    r465 r466  
    1313from mystic.termination import ChangeOverGeneration, VTR 
    1414from mystic.tools import getch, random_seed 
    15 from mystic.tools import VerboseSow as MySow 
     15from mystic.monitors import VerboseMonitor as MyMonitor 
    1616 
    1717from mystic.models.br8 import decay; F = decay.ForwardFactory 
     
    6363    solver = DifferentialEvolutionSolver(ND, NP) 
    6464    solver.enable_signal_handler() 
    65     stepmon = MySow(interval) 
     65    stepmon = MyMonitor(interval) 
    6666    solver.SetRandomInitialPoints(min=minrange,max=maxrange) 
    6767    solver.SetStrictRanges(min=minrange, max=maxrange) 
  • mystic/examples/test_ffit.py

    r465 r466  
    1919from mystic.strategy import Best1Exp, Best1Bin, Rand1Exp 
    2020from mystic.math import poly1d 
    21 from mystic.tools import getch, VerboseSow 
     21from mystic.monitors import VerboseMonitor 
     22from mystic.tools import getch 
    2223 
    2324import random 
     
    7273    solver.Solve(ChebyshevCost, termination=VTR(0.01), strategy=strategy, \ 
    7374                 CrossProbability=1.0, ScalingFactor=0.9 , \ 
    74                  StepMonitor=VerboseSow(30), sigint_callback=plot_solution) 
     75                 StepMonitor=VerboseMonitor(30), sigint_callback=plot_solution) 
    7576 
    7677    solution = solver.Solution() 
  • mystic/examples/test_ffit2.py

    r465 r466  
    1515from mystic.strategy import Best1Exp, Best1Bin, Rand1Exp, Best2Bin, Best2Exp 
    1616from mystic.math import poly1d 
    17 from mystic.tools import VerboseSow 
     17from mystic.monitors import VerboseMonitor 
    1818from mystic.models.poly import chebyshev16cost 
    1919 
     
    4949 
    5050    solver.Solve(ChebyshevCost, termination=VTR(0.0001), strategy=strategy, \ 
    51                  StepMonitor=VerboseSow(10), CrossProbability=1.0, ScalingFactor=0.6) 
     51                 StepMonitor=VerboseMonitor(10), CrossProbability=1.0, ScalingFactor=0.6) 
    5252 
    5353    solution = solver.Solution() 
  • mystic/examples/test_ffitB.py

    r465 r466  
    2727    solver.Solve(ChebyshevCost, termination=VTR(0.01), strategy=strategy, \ 
    2828                 CrossProbability=1.0, ScalingFactor=0.9 , \ 
    29                  StepMonitor=VerboseSow(30), sigint_callback=plot_solution) 
     29                 StepMonitor=VerboseMonitor(30), sigint_callback=plot_solution) 
    3030 
    3131    solution = solver.Solution() 
  • mystic/examples/test_getCost.py

    r465 r466  
    1212from mystic.models import poly; PolyCostFactory = poly.CostFactory 
    1313from mystic.solvers import DifferentialEvolutionSolver 
    14 from mystic.tools import VerboseSow, getch 
     14from mystic.monitors import VerboseMonitor 
     15from mystic.tools import getch 
    1516 
    1617ND = 3 
     
    2930    solver.enable_signal_handler() 
    3031 
    31     stepmon = VerboseSow(10,50) 
     32    stepmon = VerboseMonitor(10,50) 
    3233    minrange = [-100., -100., -100.]; 
    3334    maxrange = [100., 100., 100.]; 
  • mystic/examples/test_lorentzian.py

    r117 r466  
    5252    solver = DifferentialEvolutionSolver(ND, NP) 
    5353    solver.enable_signal_handler() 
    54     stepmon = Sow() 
     54    stepmon = Monitor() 
    5555    solver.SetRandomInitialPoints(min=minrange,max=maxrange) 
    5656    solver.SetStrictRanges(min=minrange,max=maxrange) 
  • mystic/examples/test_lorentzian2.py

    r465 r466  
    1313from mystic.termination import ChangeOverGeneration, VTR 
    1414from mystic.strategy import Best1Exp, Rand1Exp, Best2Exp, Best2Exp 
    15 from mystic.tools import getch, Sow, random_seed 
     15from mystic.monitors import Monitor 
     16from mystic.tools import getch, random_seed 
    1617 
    1718random.seed(123) 
     
    5354    solver = DifferentialEvolutionSolver(ND, NP) 
    5455    solver.enable_signal_handler() 
    55     stepmon = Sow() 
     56    stepmon = Monitor() 
    5657    solver.SetRandomInitialPoints(min=minrange,max=maxrange) 
    5758    solver.SetStrictRanges(min=minrange,max=maxrange) 
  • mystic/examples/test_mogi.py

    r465 r466  
    2323from mystic.solvers import DifferentialEvolutionSolver 
    2424from mystic.termination import ChangeOverGeneration, VTR 
    25 from mystic.tools import getch, Sow, random_seed, VerboseSow 
     25from mystic.monitors import Monitor, VerboseMonitor 
     26from mystic.tools import getch, random_seed 
    2627 
    2728from numpy import pi, sqrt, array, mgrid, random, real, conjugate, arange 
     
    8283    solver = DifferentialEvolutionSolver(ND, NP) 
    8384 
    84     stepmon = Sow() 
     85    stepmon = Monitor() 
    8586    minrange = [-1000., -1000., -100., -10.]; 
    8687    maxrange = [1000., 1000., 100., 10.]; 
     
    124125    #point = dstepmon.x[-150] 
    125126    # 
    126     simplex, esow = Sow(), Sow() 
     127    simplex, esow = Monitor(), Monitor() 
    127128    solver = fmin(len(point)) 
    128129    solver.SetInitialPoints(point) 
  • mystic/examples/test_mogi2.py

    r133 r466  
    6262    solver.enable_signal_handler() 
    6363 
    64     stepmon = VerboseSow() 
     64    stepmon = VerboseMonitor() 
    6565    minrange = [-1000., -1000., -100., -1.]*2; 
    6666    maxrange = [1000., 1000., 100., 1.]*2; 
  • mystic/examples/test_mogi3.py

    r117 r466  
    1515    solver = DifferentialEvolutionSolver(ND, NP) 
    1616 
    17     stepmon = Sow() 
     17    stepmon = Monitor() 
    1818    minrange = [-1000., -1000., -100., -10.]; 
    1919    maxrange = [1000., 1000., 100., 10.]; 
  • mystic/examples/test_mogi4.py

    r465 r466  
    88from mystic.solvers import DifferentialEvolutionSolver 
    99from mystic.termination import ChangeOverGeneration, VTR 
    10 from mystic.tools import getch, Sow, random_seed 
     10from mystic.monitors import Monitor 
     11from mystic.tools import getch, random_seed 
    1112 
    1213from mystic.forward_model import CostFactory 
     
    1819    solver.enable_signal_handler() 
    1920 
    20     stepmon = Sow() 
     21    stepmon = Monitor() 
    2122    minrange = [-1000., -1000., -100., -1.]*2; 
    2223    maxrange = [1000., 1000., 100., 1.]*2; 
  • mystic/examples/test_rosenbrock.py

    r465 r466  
    1616from mystic.termination import ChangeOverGeneration, VTR 
    1717from mystic.models import rosen 
    18 from mystic.tools import Sow, VerboseSow 
     18from mystic.monitors import Monitor, VerboseMonitor 
    1919 
    2020import random 
     
    6262    print "======================" 
    6363    start = time.time() 
    64     esow= Sow() 
    65     ssow= Sow() 
    66    #ssow= VerboseSow(1) 
     64    esow= Monitor() 
     65    ssow= Monitor() 
     66   #ssow= VerboseMonitor(1) 
    6767 
    6868 #  xinit = [random.random() for j in range(ND)] 
  • mystic/examples/test_rosenbrock2.py

    r465 r466  
    2424    print "===================" 
    2525    start = time.time() 
    26     from mystic.tools import Sow, VerboseSow 
    27    #stepmon = VerboseSow(1) 
    28     stepmon = Sow() #VerboseSow(10) 
     26    from mystic.monitors import Monitor, VerboseMonitor 
     27   #stepmon = VerboseMonitor(1) 
     28    stepmon = Monitor() #VerboseMonitor(10) 
    2929    from mystic.termination import CandidateRelativeTolerance as CRT 
    3030 
  • mystic/examples/test_rosenbrock3.py

    r465 r466  
    2828    print "===========================" 
    2929    start = time.time() 
    30     from mystic.tools import Sow, VerboseSow 
    31     stepmon = VerboseSow(1,1) 
    32    #stepmon = Sow() #VerboseSow(10) 
     30    from mystic.monitors import Monitor, VerboseMonitor 
     31    stepmon = VerboseMonitor(1,1) 
     32   #stepmon = Monitor() #VerboseMonitor(10) 
    3333    from mystic.termination import NormalizedChangeOverGeneration as NCOG 
    3434 
  • mystic/examples/test_wavy.py

    r465 r466  
    88from mystic.termination import ChangeOverGeneration, VTR 
    99from mystic.strategy import Best1Exp, Best1Bin, Rand1Exp 
    10 from mystic.tools import getch, VerboseSow 
     10from mystic.monitors import VerboseMonitor 
     11from mystic.tools import getch 
    1112from numpy import arange 
    1213from mystic.solvers import fmin 
     
    5253 
    5354    strategy = Best1Bin 
    54     stepmon = VerboseSow(1) 
     55    stepmon = VerboseMonitor(1) 
    5556    solver.Solve(wavy, 
    5657                 termination = ChangeOverGeneration(generations=50), \ 
  • mystic/examples/test_zimmermann.py

    r465 r466  
    5151    print "CPU Time: %s" % timetaken 
    5252 
    53     from mystic.tools import Sow 
     53    from mystic.monitors import Monitor 
    5454    from mystic.solvers import NelderMeadSimplexSolver as fmin 
    5555    from mystic.termination import CandidateRelativeTolerance as CRT 
    5656 
    57     simplex = Sow() 
    58     esow = Sow() 
     57    simplex = Monitor() 
     58    esow = Monitor() 
    5959    xinit = [random.uniform(0,5) for j in range(ND)] 
    6060 
  • mystic/examples_other/sam_corana2.py

    r465 r466  
    1313from mystic.solvers import NelderMeadSimplexSolver as fmin 
    1414from mystic.termination import CandidateRelativeTolerance as CRT 
    15 from mystic.tools import getch, Sow 
     15from mystic.monitors import Monitor 
     16from mystic.tools import getch 
    1617 
    1718from mystic.models.corana import corana2d as Corana2 
     
    4142 
    4243def run_once(): 
    43     simplex = Sow() 
     44    simplex = Monitor() 
    4445    solver = fmin(2) 
    4546    solver.SetRandomInitialPoints([0,0],[2,2]) 
  • mystic/examples_other/sam_mogi.py

    r465 r466  
    1111from mystic.solvers import NelderMeadSimplexSolver as fmin 
    1212from mystic.termination import CandidateRelativeTolerance as CRT 
    13 from mystic.tools import getch, Sow 
     13from mystic.monitors import Monitor 
     14from mystic.tools import getch 
    1415 
    1516x0,y0,z0,v0 = actual_params 
     
    5960 
    6061def run_once_xy(): 
    61     simplex = Sow() 
     62    simplex = Monitor() 
    6263    z1 = z0*random.uniform(0.5,1.5) 
    6364    v1 = v0*random.uniform(0.5,1.5) 
     
    7778 
    7879def run_once_xv(): 
    79     simplex = Sow() 
     80    simplex = Monitor() 
    8081    y1 = y0*random.uniform(0.5,1.5) 
    8182    z1 = z0*random.uniform(0.5,1.5) 
  • mystic/examples_other/sam_rosenbrock.py

    r465 r466  
    1414from mystic.solvers import NelderMeadSimplexSolver as fmin 
    1515from mystic.termination import CandidateRelativeTolerance as CRT 
    16 from mystic.tools import getch, Sow 
     16from mystic.monitors import Monitor 
     17from mystic.tools import getch 
    1718 
    1819def draw_contour(): 
     
    4041 
    4142def run_once(x0,x1): 
    42     simplex = Sow() 
     43    simplex = Monitor() 
    4344    xinit = [x0, x1] 
    4445 
  • mystic/examples_other/sam_zimmermann.py

    r465 r466  
    1414from mystic.solvers import NelderMeadSimplexSolver as fmin 
    1515from mystic.termination import CandidateRelativeTolerance as CRT 
    16 from mystic.tools import getch, Sow 
     16from mystic.monitors import Monitor 
     17from mystic.tools import getch 
    1718 
    1819def draw_contour(): 
     
    3940 
    4041def run_once(): 
    41     simplex = Sow() 
     42    simplex = Monitor() 
    4243    solver = fmin(2) 
    4344    solver.SetRandomInitialPoints([0,0],[7,7]) 
  • mystic/mystic/Make.mm

    r465 r466  
    3838    helputil.py \ 
    3939    linesearch.py \ 
     40    monitors.py \ 
    4041    mystic_math.py \ 
    4142    nested.py \ 
  • mystic/mystic/__init__.py

    r465 r466  
    153153    - mystic.mystic.termination            [solver termination conditions] 
    154154    - mystic.mystic.strategy               [solver population mutation strategies] 
    155     - mystic.mystic.tools                  [monitors, function wrappers, and other tools] 
     155    - mystic.mystic.monitors               [optimization monitors] 
     156    - mystic.mystic.tools                  [function wrappers, etc] 
    156157    - mystic.mystic.forward_model          [cost function generator] 
    157158    - mystic.models                        [a collection of standard models] 
     
    237238 
    238239# monitors, function wrappers, and other tools 
    239 # import monitors 
     240import monitors 
    240241import munge 
    241242import tools 
  • mystic/mystic/_genSow.py

    r335 r466  
    33# Mike McKerns, Caltech 
    44  
    5 """a helper class for the CustomSow function""" 
     5"""a helper class for the CustomMonitor function""" 
    66 
    77class genSow(object): 
    88    """ 
    9 a configurable Sow (monitor) generator 
     9a configurable Monitor generator 
    1010    """ 
    1111    def __init__(self,**kwds): 
    1212        """ 
    13 Build a Sow, with channels for the provided properties 
     13Build a Monitor, with channels for the provided properties 
    1414Takes **kwds of the form property="doc". 
    1515        """ 
     
    3232        """ 
    3333Takes string names of properties (given as *args), and sets the 
    34 corresponding properties as required inputs for the Sow. 
     34corresponding properties as required inputs for the Monitor. 
    3535        """ 
    3636        self.__args = [ i for i in args if self.__dict.has_key(i) ] 
    37         exec(self._genClass()) # generates Sow() 
    38         return Sow() 
     37        exec(self._genClass()) # generates Monitor() 
     38        return Monitor() 
    3939       #return self._genClass() 
    4040 
    4141    def _genClass(self): 
    42         """append the code blocks for the entire Sow class""" 
     42        """append the code blocks for the entire Monitor class""" 
    4343        code = self.__genHead() + \ 
    4444               self.__genInit() + \ 
     
    4949 
    5050    def __genHead(self): 
    51         """build the code block for the Sow class header""" 
     51        """build the code block for the Monitor class header""" 
    5252        code0 = """ 
    53 class Sow(object): 
     53class Monitor(object): 
    5454""" 
    5555        return code0 
    5656 
    5757    def __genInit(self): 
    58         """build the code block for the Sow class __init__ method""" 
     58        """build the code block for the Monitor class __init__ method""" 
    5959        code1 = """ 
    6060    def __init__(self): 
     
    6565 
    6666    def __genCall(self): 
    67         """build the code block for the Sow class __call__ method""" 
     67        """build the code block for the Monitor class __call__ method""" 
    6868        code2 = """ 
    6969    def __call__(self,""" 
     
    8181 
    8282    def __genMeth(self): 
    83         """build the code block for the remaining Sow class methods""" 
     83        """build the code block for the remaining Monitor class methods""" 
    8484        code3 = """ 
    8585""" 
     
    8989 
    9090    def __genProp(self): 
    91         """build the code block for the Sow class properties""" 
     91        """build the code block for the Monitor class properties""" 
    9292        code4 = """ 
    9393""" 
  • mystic/mystic/abstract_map_solver.py

    r462 r466  
    3131    >>>  
    3232    >>> # get monitors and termination condition objects 
    33     >>> from mystic.tools import Sow 
    34     >>> stepmon = Sow() 
     33    >>> from mystic.monitors import Monitor 
     34    >>> stepmon = Monitor() 
    3535    >>> from mystic.termination import CandidateRelativeTolerance as CRT 
    3636    >>>  
     
    4343    >>> 
    4444    >>> # instantiate and configure the solver 
    45     >>> from mystic.nested import ScattershotSolver 
     45    >>> from mystic.solvers import ScattershotSolver 
    4646    >>> solver = ScattershotSolver(len(lb), npts) 
    4747    >>> solver.SetMapper(ez_map2, equalportion_mapper) 
  • mystic/mystic/abstract_nested_solver.py

    r462 r466  
    3131    >>>  
    3232    >>> # get monitors and termination condition objects 
    33     >>> from mystic.tools import Sow 
    34     >>> stepmon = Sow() 
     33    >>> from mystic.monitors import Monitor 
     34    >>> stepmon = Monitor() 
    3535    >>> from mystic.termination import CandidateRelativeTolerance as CRT 
    3636    >>>  
     
    4242    >>> 
    4343    >>> # instantiate and configure the solver 
    44     >>> from mystic.scipy_optimize import NelderMeadSimplexSolver 
    45     >>> from mystic.nested import BatchGridSolver 
     44    >>> from mystic.solvers import NelderMeadSimplexSolver 
     45    >>> from mystic.solvers import BatchGridSolver 
    4646    >>> solver = BatchGridSolver(len(nbins), nbins) 
    4747    >>> solver.SetNestedSolver(NelderMeadSimplexSolver) 
     
    118118        if kwds.has_key('npts'): npts = kwds['npts'] 
    119119        self._npts            = npts 
    120         from mystic.scipy_optimize import NelderMeadSimplexSolver 
     120        from mystic.solvers import NelderMeadSimplexSolver 
    121121        self._solver          = NelderMeadSimplexSolver 
    122122        return 
  • mystic/mystic/abstract_solver.py

    r462 r466  
    2424    >>>  
    2525    >>> # get monitors and termination condition objects 
    26     >>> from mystic.tools import Sow 
    27     >>> stepmon = Sow() 
    28     >>> evalmon = Sow() 
     26    >>> from mystic.monitors import Monitor 
     27    >>> stepmon = Monitor() 
     28    >>> evalmon = Monitor() 
    2929    >>> from mystic.termination import CandidateRelativeTolerance as CRT 
    3030    >>>  
    3131    >>> # instantiate and configure the solver 
    32     >>> from mystic.scipy_optimize import NelderMeadSimplexSolver 
     32    >>> from mystic.solvers import NelderMeadSimplexSolver 
    3333    >>> solver = NelderMeadSimplexSolver(len(x0)) 
    3434    >>> solver.SetInitialPoints(x0) 
     
    4848    >>>  
    4949    >>> # configure the solver and obtain the solution 
    50     >>> from mystic.scipy_optimize import fmin 
     50    >>> from mystic.solvers import fmin 
    5151    >>> solution = fmin(rosen,x0) 
    5252 
  • mystic/mystic/constraints.py

    r440 r466  
    546546        return 1. 
    547547 
    548     from mystic.differential_evolution import DifferentialEvolutionSolver 
     548    from mystic.solvers import DifferentialEvolutionSolver 
    549549    from mystic.termination import ChangeOverGeneration as COG 
    550550    solver = DifferentialEvolutionSolver(ndim, 40) 
  • mystic/mystic/differential_evolution.py

    r465 r466  
    5050 
    5151Mystic solver behavior activated in diffev and diffev2:: 
    52     - EvaluationMonitor = Sow() 
    53     - StepMonitor = Sow() 
     52    - EvaluationMonitor = Monitor() 
     53    - StepMonitor = Monitor() 
    5454    - enable_signal_handler() 
    5555    - strategy = Best1Exp 
     
    671671        invariant_current = kwds['invariant_current'] 
    672672 
    673     from mystic.tools import Sow 
    674     stepmon = Sow() 
    675     evalmon = Sow() 
     673    from mystic.monitors import Monitor 
     674    stepmon = Monitor() 
     675    evalmon = Monitor() 
    676676   #from mystic.strategy import Best1Exp #, Best1Bin, Rand1Exp 
    677677   #strategy = Best1Exp 
  • mystic/mystic/nested.py

    r465 r466  
    134134def local_optimize(cost, termination, x0, rank): 
    135135    from %s import %s as LocalSolver 
    136     from mystic.tools import Sow 
    137  
    138     stepmon = Sow() 
    139     evalmon = Sow() 
     136    from mystic.monitors import Monitor 
     137 
     138    stepmon = Monitor() 
     139    evalmon = Monitor() 
    140140 
    141141    ndim = len(x0) 
     
    308308def local_optimize(cost, termination, x0, rank): 
    309309    from %s import %s as LocalSolver 
    310     from mystic.tools import Sow 
    311  
    312     stepmon = Sow() 
    313     evalmon = Sow() 
     310    from mystic.monitors import Monitor 
     311 
     312    stepmon = Monitor() 
     313    evalmon = Monitor() 
    314314 
    315315    ndim = len(x0) 
  • mystic/mystic/scipy_optimize.py

    r462 r466  
    3232 
    3333Mystic solver behavior activated in fmin:: 
    34    - EvaluationMonitor = Sow() 
    35    - StepMonitor = Sow() 
     34   - EvaluationMonitor = Monitor() 
     35   - StepMonitor = Monitor() 
    3636   - termination = CandidateRelativeTolerance(xtol,ftol) 
    3737   - enable_signal_handler() 
    3838 
    3939Mystic solver behavior activated in fmin_powell:: 
    40    - EvaluationMonitor = Sow() 
    41    - StepMonitor = Sow() 
     40   - EvaluationMonitor = Monitor() 
     41   - StepMonitor = Monitor() 
    4242   - termination = NormalizedChangeOverGeneration(ftol) 
    4343   - enable_signal_handler() 
     
    390390    """ 
    391391 
    392     from mystic.tools import Sow 
    393     stepmon = Sow() 
    394     evalmon = Sow() 
     392    from mystic.monitors import Monitor 
     393    stepmon = Monitor() 
     394    evalmon = Monitor() 
    395395    from mystic.termination import CandidateRelativeTolerance as CRT 
    396396 
     
    702702    #        - should just pass 'direc', and then hands-off ?  How return it ? 
    703703 
    704     from mystic.tools import Sow 
    705     stepmon = Sow() 
    706     evalmon = Sow() 
     704    from mystic.monitors import Monitor 
     705    stepmon = Monitor() 
     706    evalmon = Monitor() 
    707707    from mystic.termination import NormalizedChangeOverGeneration as NCOG 
    708708 
  • mystic/mystic/tools.py

    r430 r466  
    1717    - Null: a Null object pattern 
    1818    - getch: provides "press any key to quit" 
    19     - Sow: A class whose instances are callable (to be used as monitors) 
    20     - VerboseSow: A verbose version of the basic Sow 
    21     - LoggingSow: A version of the basic Sow that logs to a file 
    22     - CustomSow: A customizable 'n-variable' version of the basic Sow 
    2319    - random_seed: sets the seed for calls to 'random()' 
    2420    - wrap_nested: nest a function call within a function object 
     
    119115           print str + " and press enter" 
    120116       return raw_input() 
    121  
    122 class Sow(object): 
    123     """ 
    124 Instances of objects that can be passed as monitors. 
    125 The Sow logs the parameters and corresponding costs, 
    126 retrievable by accessing the Sow's member variables. 
    127  
    128 example usage... 
    129     >>> sow = Sow() 
    130     >>> solver.Solve(rosen, x0, EvaulationMonitor=sow) 
    131     >>> sow.x   # get log of parameters 
    132     >>> sow.y   # get log of costs 
    133  
    134     """ 
    135     def __init__(self, **kwds):#, all=True): 
    136         self._x = [] 
    137         self._y = [] 
    138         self._id = [] 
    139        #self._all = all 
    140  
    141     def __call__(self, x, y, id=None, **kwds):#, best=0): 
    142         self._x.append(listify(x)) #XXX: better to save as-is? 
    143         self._y.append(listify(y)) #XXX: better to save as-is? 
    144         self._id.append(id) 
    145        #if not self._all and list_or_tuple_or_ndarray(x): 
    146        #    self._x[-1] = self._x[-1][best] 
    147        #if not self._all and list_or_tuple_or_ndarray(y): 
    148        #    self._y[-1] = self._y[-1][best] 
    149  
    150     def get_x(self): 
    151         return self._x 
    152  
    153     def get_y(self): 
    154         return self._y 
    155  
    156     def get_id(self): 
    157         return self._id 
    158  
    159     x = property(get_x, doc = "Params") 
    160     y = property(get_y, doc = "Costs") 
    161     id = property(get_id, doc = "Id") 
    162     pass 
    163  
    164 class VerboseSow(Sow): 
    165     """A verbose version of the basic Sow. 
    166  
    167 Prints ChiSq every 'interval', and optionally prints 
    168 current parameters every 'xinterval'. 
    169     """ 
    170     import numpy 
    171     def __init__(self, interval = 10, xinterval = numpy.inf, all=True): 
    172         super(VerboseSow,self).__init__() 
    173         self._step = 0 
    174         self._yinterval = interval 
    175         self._xinterval = xinterval 
    176         self._all = all 
    177         return 
    178     def __call__(self, x, y, id=None, best=0): 
    179         super(VerboseSow,self).__call__(x, y, id) 
    180         if int(self._step % self._yinterval) == 0: 
    181             if not list_or_tuple_or_ndarray(y): 
    182                 who = '' 
    183                 y = " %f" % self._y[-1] 
    184             elif self._all: 
    185                 who = '' 
    186                 y = " %s" % self._y[-1] 
    187             else: 
    188                 who = ' best' 
    189                 y = " %f" % self._y[-1][best] 
    190             msg = "Generation %d has%s Chi-Squared:%s" % (self._step, who, y) 
    191             if id != None: msg = "[id: %d] " % (id) + msg 
    192             print msg 
    193         if int(self._step % self._xinterval) == 0: 
    194             if not list_or_tuple_or_ndarray(x): 
    195                 who = '' 
    196                 x = " %f" % self._x[-1] 
    197             elif self._all: 
    198                 who = '' 
    199                 x = "\n %s" % self._x[-1] 
    200             else: 
    201                 who = ' best' 
    202                 x = "\n %s" % self._x[-1][best] 
    203             msg = "Generation %d has%s fit parameters:%s" % (self._step, who, x) 
    204             if id != None: msg = "[id: %d] " % (id) + msg 
    205             print msg 
    206         self._step += 1 
    207         return 
    208     pass 
    209  
    210 class LoggingSow(Sow): 
    211     """A version of the basic Sow that writes to a file at specified intervals. 
    212  
    213 Logs ChiSq and parameters to a file every 'interval' 
    214     """ 
    215     import numpy 
    216     def __init__(self, interval=1, filename='log.txt', new=False, all=True): 
    217         import datetime 
    218         super(LoggingSow,self).__init__() 
    219         self._filename = filename 
    220         self._step = 0 
    221         self._yinterval = interval 
    222         self._xinterval = interval 
    223         if new: ind = 'w' 
    224         else: ind = 'a' 
    225         self._file = open(self._filename,ind) 
    226         self._file.write("# %s\n" % datetime.datetime.now().ctime() ) 
    227         self._file.write("# ___#___  __ChiSq__  __params__\n") 
    228         self._file.close() 
    229         self._all = all 
    230         return 
    231     def __call__(self, x, y, id=None, best=0): 
    232         self._file = open(self._filename,'a') 
    233         super(LoggingSow,self).__call__(x, y, id) 
    234         if int(self._step % self._yinterval) == 0: 
    235             if not list_or_tuple_or_ndarray(y): 
    236                 y = "%f" % self._y[-1] 
    237             elif self._all: 
    238                 y = "%s" % self._y[-1] 
    239             else: 
    240                 y = "%f" % self._y[-1][best] 
    241             if not list_or_tuple_or_ndarray(x): 
    242                 x = "[%f]" % self._x[-1] 
    243             elif self._all: 
    244                 xa = self._x[-1] 
    245                 if not list_or_tuple_or_ndarray(xa): 
    246                   x = "[%f]" % xa 
    247                 else: 
    248                   x = "%s" % xa 
    249             else: 
    250                 xb = self._x[-1][best] 
    251                 if not list_or_tuple_or_ndarray(xb): 
    252                   x = "[%f]" % xb 
    253                 else: 
    254                   x = "%s" % xb 
    255             step = [self._step] 
    256             if id != None: step.append(id) 
    257             self._file.write("  %s     %s   %s\n" % (tuple(step), y, x)) 
    258         self._step += 1 
    259         self._file.close() 
    260         return 
    261     pass 
    262  
    263 def CustomSow(*args,**kwds): 
    264     """ 
    265 generate a custom Sow 
    266  
    267 takes *args & **kwds, where args will be required inputs for the Sow:: 
    268     - args: property name strings (i.e. 'x') 
    269     - kwds: must be in the form: property="doc" (i.e. x='Params') 
    270  
    271 example usage... 
    272     >>> sow = CustomSow('x','y',x="Params",y="Costs",e="Error",d="Deriv") 
    273     >>> sow(1,1) 
    274     >>> sow(2,4,e=0) 
    275     >>> sow.x 
    276     [1,2] 
    277     >>> sow.y 
    278     [1,4] 
    279     >>> sow.e 
    280     [0] 
    281     >>> sow.d 
    282     [] 
    283     """ 
    284     from _genSow import genSow 
    285     return genSow(**kwds)(*args) 
    286117 
    287118def random_seed(s): 
     
    436267 
    437268 
     269# backward compatibility 
     270from monitors import Monitor as Sow 
     271from monitors import VerboseMonitor as VerboseSow 
     272from monitors import LoggingMonitor as LoggingSow 
     273from monitors import CustomMonitor as CustomSow 
     274 
     275 
    438276if __name__=='__main__': 
    439277    import doctest 
  • mystic/scripts/mystic_log_reader.py

    r436 r466  
    11#!/usr/bin/env python 
    22__doc__ = """ 
    3 plot parameter convergence from file written with 'LoggingSow' 
     3plot parameter convergence from file written with 'LoggingMonitor' 
    44 
    55Usage: python log_reader.py [filename] [maxiter] 
  • mystic/tests/solver_test_best_performance.py

    r465 r466  
    33adjusted to achieve the best results. 
    44""" 
    5 from mystic.tools import random_seed, Sow 
     5from mystic.monitors import Monitor 
     6from mystic.tools import random_seed 
    67random_seed(123) 
    78import time 
     
    5758    from mystic.termination import ChangeOverGeneration as COG 
    5859    from mystic.strategy import Rand1Bin 
    59     esow = Sow() 
    60     ssow = Sow()  
     60    esow = Monitor() 
     61    ssow = Monitor()  
    6162    solver = DifferentialEvolutionSolver(ndim, npop) 
    6263    solver.SetInitialPoints(x0) 
     
    8182    from mystic.termination import ChangeOverGeneration as COG 
    8283    from mystic.strategy import Rand1Bin 
    83     esow = Sow() 
    84     ssow = Sow()  
     84    esow = Monitor() 
     85    ssow = Monitor()  
    8586    solver = DifferentialEvolutionSolver2(ndim, npop) 
    8687    solver.SetInitialPoints(x0) 
     
    103104    from mystic.solvers import NelderMeadSimplexSolver 
    104105    from mystic.termination import CandidateRelativeTolerance as CRT 
    105     esow = Sow() 
    106     ssow = Sow()  
     106    esow = Monitor() 
     107    ssow = Monitor()  
    107108    solver = NelderMeadSimplexSolver(ndim) 
    108109    solver.SetInitialPoints(x0) 
     
    124125    from mystic.solvers import PowellDirectionalSolver 
    125126    from mystic.termination import NormalizedChangeOverGeneration as NCOG 
    126     esow = Sow() 
    127     ssow = Sow()  
     127    esow = Monitor() 
     128    ssow = Monitor()  
    128129    solver = PowellDirectionalSolver(ndim) 
    129130    solver.SetInitialPoints(x0) 
     
    184185    from mystic.termination import VTR 
    185186    from mystic.strategy import Rand1Bin, Best1Bin, Rand1Exp 
    186     esow = Sow() 
    187     ssow = Sow()  
     187    esow = Monitor() 
     188    ssow = Monitor()  
    188189    solver = DifferentialEvolutionSolver(ndim, npop) 
    189190    solver.SetRandomInitialPoints(lb, ub) 
     
    214215    from mystic.termination import VTR 
    215216    from mystic.strategy import Rand1Bin, Best1Bin, Rand1Exp 
    216     esow = Sow() 
    217     ssow = Sow()  
     217    esow = Monitor() 
     218    ssow = Monitor()  
    218219    solver = DifferentialEvolutionSolver2(ndim, npop) 
    219220    solver.SetRandomInitialPoints(lb, ub) 
  • mystic/tests/solver_test_suite.py

    r465 r466  
    2929 
    3030    def _run_solver(self, iter_limit=False, local=False, **kwds): 
    31         from mystic.tools import Sow 
     31        from mystic.monitors import Monitor 
    3232        import numpy 
    3333        from mystic.tools import random_seed 
    3434        random_seed(123) # Number of failures is quite dependent on random seed! 
    35         esow = Sow() 
    36         ssow = Sow()  
     35        esow = Monitor() 
     36        ssow = Monitor()  
    3737 
    3838        if iter_limit: # CRT with solvers that don't use population. 
     
    239239 
    240240    def _run_solver(self, iter_limit=False, **kwds): 
    241         from mystic.tools import Sow 
     241        from mystic.monitors import Monitor 
    242242        import numpy 
    243243        from mystic.tools import random_seed 
    244244        #random_seed(123) 
    245         esow = Sow() 
    246         ssow = Sow()  
     245        esow = Monitor() 
     246        ssow = Monitor()  
    247247 
    248248        solver = self.solver 
     
    439439 
    440440    def _run_solver(self, iter_limit=False, **kwds): 
    441         from mystic.tools import Sow 
     441        from mystic.monitors import Monitor 
    442442        import numpy 
    443443        from mystic.tools import random_seed 
    444444        random_seed(123) 
    445         esow = Sow() 
    446         ssow = Sow()  
     445        esow = Monitor() 
     446        ssow = Monitor()  
    447447 
    448448        solver = self.solver 
     
    639639 
    640640    def _run_solver(self, iter_limit=False, **kwds): 
    641         from mystic.tools import Sow 
     641        from mystic.monitors import Monitor 
    642642        import numpy 
    643643        from mystic.tools import random_seed 
    644644        #random_seed(123) 
    645         esow = Sow() 
    646         ssow = Sow()  
     645        esow = Monitor() 
     646        ssow = Monitor()  
    647647 
    648648        solver = self.solver 
     
    837837 
    838838    def _run_solver(self, iter_limit=False, **kwds): 
    839         from mystic.tools import Sow 
     839        from mystic.monitors import Monitor 
    840840        import numpy 
    841841        from mystic.tools import random_seed 
    842842        random_seed(123) 
    843         esow = Sow() 
    844         ssow = Sow()  
     843        esow = Monitor() 
     844        ssow = Monitor()  
    845845 
    846846        solver = self.solver 
     
    10361036 
    10371037    def _run_solver(self, iter_limit = False, **kwds): 
    1038         from mystic.tools import Sow 
     1038        from mystic.monitors import Monitor 
    10391039        import numpy 
    10401040        from mystic.tools import random_seed 
    10411041       #random_seed(123) 
    1042         esow = Sow() 
    1043         ssow = Sow()  
     1042        esow = Monitor() 
     1043        ssow = Monitor()  
    10441044 
    10451045        solver = self.solver 
     
    12361236 
    12371237    def _run_solver(self, iter_limit=False, **kwds): 
    1238         from mystic.tools import Sow 
     1238        from mystic.monitors import Monitor 
    12391239        import numpy 
    12401240        from mystic.tools import random_seed 
    12411241        #random_seed(123) 
    1242         esow = Sow() 
    1243         ssow = Sow()  
     1242        esow = Monitor() 
     1243        ssow = Monitor()  
    12441244 
    12451245        solver = self.solver 
     
    14481448 
    14491449    def _run_solver(self, iter_limit=False, **kwds): 
    1450         from mystic.tools import Sow 
     1450        from mystic.monitors import Monitor 
    14511451        import numpy 
    14521452        from mystic.tools import random_seed 
    14531453        #random_seed(123) 
    1454         esow = Sow() 
    1455         ssow = Sow()  
     1454        esow = Monitor() 
     1455        ssow = Monitor()  
    14561456 
    14571457        solver = self.solver 
     
    16591659 
    16601660    def _run_solver(self, iter_limit=False, **kwds): 
    1661         from mystic.tools import Sow 
     1661        from mystic.monitors import Monitor 
    16621662        import numpy 
    16631663        from mystic.tools import random_seed 
    16641664        #random_seed(123) 
    1665         esow = Sow() 
    1666         ssow = Sow()  
     1665        esow = Monitor() 
     1666        ssow = Monitor()  
    16671667 
    16681668        solver = self.solver 
     
    18671867 
    18681868    def _run_solver(self, iter_limit=False, **kwds): 
    1869         from mystic.tools import Sow 
     1869        from mystic.monitors import Monitor 
    18701870        import numpy 
    18711871        from mystic.tools import random_seed 
    18721872        random_seed(123) 
    1873         esow = Sow() 
    1874         ssow = Sow()  
     1873        esow = Monitor() 
     1874        ssow = Monitor()  
    18751875 
    18761876        solver = self.solver 
     
    20732073 
    20742074    def _run_solver(self, iter_limit=False, **kwds): 
    2075         from mystic.tools import Sow 
     2075        from mystic.monitors import Monitor 
    20762076        import numpy 
    20772077        from mystic.tools import random_seed 
    20782078        random_seed(123) 
    2079         esow = Sow() 
    2080         ssow = Sow()  
     2079        esow = Monitor() 
     2080        ssow = Monitor()  
    20812081 
    20822082        solver = self.solver 
     
    22842284 
    22852285    def _run_solver(self, iter_limit=False, **kwds): 
    2286         from mystic.tools import Sow 
     2286        from mystic.monitors import Monitor 
    22872287        import numpy 
    22882288        from mystic.tools import random_seed 
    22892289        random_seed(123) 
    2290         esow = Sow() 
    2291         ssow = Sow()  
     2290        esow = Monitor() 
     2291        ssow = Monitor()  
    22922292 
    22932293        solver = self.solver 
     
    24902490 
    24912491    def _run_solver(self, iter_limit=False, **kwds): 
    2492         from mystic.tools import Sow 
     2492        from mystic.monitors import Monitor 
    24932493        import numpy 
    24942494        from mystic.tools import random_seed 
    24952495        random_seed(123) 
    2496         esow = Sow() 
    2497         ssow = Sow()  
     2496        esow = Monitor() 
     2497        ssow = Monitor()  
    24982498 
    24992499        solver = self.solver 
     
    26952695 
    26962696    def _run_solver(self, iter_limit=False, **kwds): 
    2697         from mystic.tools import Sow 
     2697        from mystic.monitors import Monitor 
    26982698        import numpy 
    26992699        from mystic.tools import random_seed 
    27002700        random_seed(123) 
    2701         esow = Sow() 
    2702         ssow = Sow()  
     2701        esow = Monitor() 
     2702        ssow = Monitor()  
    27032703 
    27042704        solver = self.solver 
     
    29012901 
    29022902    def _run_solver(self, iter_limit=False, **kwds): 
    2903         from mystic.tools import Sow 
     2903        from mystic.monitors import Monitor 
    29042904        import numpy 
    29052905        from mystic.tools import random_seed 
    29062906        random_seed(123) 
    2907         esow = Sow() 
    2908         ssow = Sow()  
     2907        esow = Monitor() 
     2908        ssow = Monitor()  
    29092909 
    29102910        solver = self.solver 
     
    31113111 
    31123112    def _run_solver(self, iter_limit=False, **kwds): 
    3113         from mystic.tools import Sow 
     3113        from mystic.monitors import Monitor 
    31143114        import numpy 
    31153115        from mystic.tools import random_seed 
    31163116        random_seed(123) 
    3117         esow = Sow() 
    3118         ssow = Sow()  
     3117        esow = Monitor() 
     3118        ssow = Monitor()  
    31193119 
    31203120        solver = self.solver 
     
    33253325 
    33263326    def _run_solver(self, iter_limit=False, **kwds): 
    3327         from mystic.tools import Sow 
     3327        from mystic.monitors import Monitor 
    33283328        import numpy 
    33293329        from mystic.tools import random_seed 
    33303330        random_seed(123) 
    3331         esow = Sow() 
    3332         ssow = Sow()  
     3331        esow = Monitor() 
     3332        ssow = Monitor()  
    33333333 
    33343334        solver = self.solver 
  • mystic/tests/test_SOW.py

    r465 r466  
    9292if __name__ == '__main__': 
    9393 
    94   from mystic.tools import Sow, VerboseSow, LoggingSow 
    95  #monitor = Sow() 
    96  #monitor = Sow(all=True) 
    97  #monitor = Sow(all=False) 
    98  #monitor = VerboseSow(1,1)  
    99  #monitor = VerboseSow(1,1, all=True)  
    100  #monitor = VerboseSow(1,1, all=False)  
    101   monitor = LoggingSow(1) 
    102  #monitor = LoggingSow(1, all=True) 
    103  #monitor = LoggingSow(1, all=False) 
     94  from mystic.monitors import Monitor, VerboseMonitor, LoggingMonitor 
     95 #monitor = Monitor() 
     96 #monitor = Monitor(all=True) 
     97 #monitor = Monitor(all=False) 
     98 #monitor = VerboseMonitor(1,1)  
     99 #monitor = VerboseMonitor(1,1, all=True)  
     100 #monitor = VerboseMonitor(1,1, all=False)  
     101  monitor = LoggingMonitor(1) 
     102 #monitor = LoggingMonitor(1, all=True) 
     103 #monitor = LoggingMonitor(1, all=False) 
    104104 
    105105 #test0(monitor) 
     
    109109 #test2(monitor, diffenv=True) 
    110110 
    111   # these are for "SowPlotter(s)"; need to adapt log.py plotters for test1 
     111  # these are for "MonitorPlotter(s)"; need to adapt log.py plotters for test1 
    112112  write_support_file(monitor,'paramlog1.py') 
    113113 #write_converge_file(monitor,'paramlog2.py') 
Note: See TracChangeset for help on using the changeset viewer.