Changeset 374


Ignore:
Timestamp:
08/04/10 17:47:48 (6 years ago)
Author:
mmckerns
Message:

moved multilogger code to scripts;
log_reader can stop at desired iteration

Files:
4 added
1 deleted
4 edited
5 copied

Legend:

Unmodified
Added
Removed
  • Makefile

    r335 r374  
    77doc: 
    88        cp -rf mystic/_math mystic/math 
     9        cp -f branches/dummy/__init__.py mystic/scripts 
    910        epydoc --config mystic.epydoc 
    1011        rm -rf mystic/math 
     12        rm -f mystic/scripts/__init__.py 
    1113        mkdir html 
    1214        mv -f shared,mpi html/mystic-${VERSION} 
  • mystic/Make.mm

    r243 r374  
    77    models \ 
    88    _math \ 
     9    scripts \ 
    910 
    1011OTHER_DIRS = \ 
  • mystic/scripts/mystic_log_reader.py

    r372 r374  
     1#!/usr/bin/env python 
     2__doc__ = """ 
     3plot parameter convergence from file written with 'LoggingSow' 
     4 
     5Usage: python log_reader.py [filename] [maxiter] 
     6    [filename] - name of the convergence logfile (e.g log.txt) 
     7    [maxiter] - the largest iteration to plot (from 1 to maxiter) [optional] 
     8""" 
    19import sys 
     10if '--help' in sys.argv: 
     11  print __doc__ 
     12  sys.exit(0) 
     13 
    214if '--dots' in sys.argv: 
    315  mark = 'o' 
     
    618  mark = '' 
    719 
    8 try: 
     20try: # get logfile name 
    921  filename = sys.argv[1] 
    1022except: 
    1123  filename = 'log.txt' 
     24 
     25try: # select which iteration to stop plotting at 
     26  stop = int(sys.argv[2]) 
     27except: 
     28  stop = None 
    1229 
    1330f = open(filename,"r") 
     
    4461    cost.append(eval(values[1])) 
    4562    param.append(eval(values[2])) 
     63 
     64# ignore everything after 'stop' 
     65step = step[:stop] 
     66cost = cost[:stop] 
     67param = param[:stop] 
    4668 
    4769# split (i,id) into iteration and id 
  • mystic/setup.py

    r335 r374  
    4444setup_code += """     
    4545      zip_safe=True, 
    46       scripts=[]) 
     46""" 
     47 
     48# add the scripts, and close 'setup' call 
     49setup_code += """ 
     50    scripts=['scripts/mystic_log_reader.py', 
     51             'scripts/support_convergence.py', 
     52             'scripts/support_hypercube.py', 
     53             'scripts/support_hypercube2.py']) 
    4754""" 
    4855 
  • mystic/tests/Make.mm

    r252 r374  
    55PACKAGE = tests 
    66 
    7 PROJ_CLEAN += $(PROJ_CPPTESTS) log1.py log2.py 
     7PROJ_CLEAN += $(PROJ_CPPTESTS) log1.py log2.py log.txt paramlog*.py  
    88 
    99PROJ_PYTESTS =  
Note: See TracChangeset for help on using the changeset viewer.