Changeset 841 for mystic


Ignore:
Timestamp:
11/20/15 18:24:39 (6 months ago)
Author:
mmckerns
Message:

add verbose option to model plotter; minor fix to import in test_smo1.py

Location:
mystic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • mystic/examples_other/test_smo1.py

    r839 r841  
    1414from numpy import * 
    1515import pylab 
    16 from mystic.svctools import * 
     16from mystic.svc import * 
    1717 
    1818# a common objective function for solving a QP problem 
  • mystic/mystic/scripts.py

    r838 r841  
    384384            dots = kwds.get('dots', False) 
    385385            join = kwds.get('join', False) 
     386            verb = kwds.get('verb', False) 
    386387 
    387388            # special case: bounds passed as list of slices 
     
    424425            cmdargs += '' if dots == False else '--dots ' 
    425426            cmdargs += '' if join == False else '--join ' 
     427            cmdargs += '' if verb == False else '--verb ' 
    426428        else: 
    427429            cmdargs = ' ' + cmdargs 
     
    471473    parser.add_option("-j","--join",action="store_true",dest="line",\ 
    472474                      default=False,help="connect trajectory points in plot") 
     475    parser.add_option("-v","--verb",action="store_true",dest="verbose",\ 
     476                      default=False,help="print model documentation string") 
    473477 
    474478#   import sys 
     
    558562    except: 
    559563      stop = ":" 
     564 
     565    try: # select whether to be verbose about model documentation 
     566      verbose = bool(parsed_opts.verbose) 
     567    except: 
     568      verbose = False 
    560569 
    561570    ################################################# 
     
    584593    if model: 
    585594        model = _model or _get_instance(model) 
     595        if verbose: print model.__doc__ 
    586596        # need a reducer if model returns an array 
    587597        if reducer: model = reduced(reducer, arraylike=False)(model) 
Note: See TracChangeset for help on using the changeset viewer.