From: W. Trevor King Date: Wed, 27 Oct 2010 15:07:08 +0000 (-0700) Subject: Use single-quote delimited strings when possssible. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fa1160606891aba3dbe89c82a1561b08e9cf51f7;p=sawsim.git Use single-quote delimited strings when possssible. --- diff --git a/pysawsim/parameter_error.py b/pysawsim/parameter_error.py index 8813e2f..9593919 100755 --- a/pysawsim/parameter_error.py +++ b/pysawsim/parameter_error.py @@ -140,9 +140,9 @@ def main(argv=None): help='Residual type (from %s; default: %%default).' % ', '.join(Histogram().types()), default='jensen-shannon') - parser.add_option("-P","--plot-residuals", dest="plot_residuals", - help="Generate residual difference plots for each point in the plot range.", - default=False, action="store_true") + parser.add_option('-P','--plot-residuals', dest='plot_residuals', + help='Generate residual difference plots for each point in the plot range.', + default=False, action='store_true') parser.add_option('-t', '--threshold', dest='threshold', metavar='FLOAT', type='float', default='0.2', help='Residual value that defines the location of the error bar (%default).') diff --git a/pysawsim/parameter_scan.py b/pysawsim/parameter_scan.py index a1ec5ba..3a4f6f9 100644 --- a/pysawsim/parameter_scan.py +++ b/pysawsim/parameter_scan.py @@ -380,35 +380,35 @@ def main(argv=None): if option.dest == 'param_string': continue parser.add_option(option) - parser.add_option("-f","--param-format", dest="param_format", - metavar="FORMAT", - help="Convert params to sawsim options (%default).", + parser.add_option('-f','--param-format', dest='param_format', + metavar='FORMAT', + help='Convert params to sawsim options (%default).', default=('-s cantilever,hooke,0.05 -N1 -s folded,null -N8 -s "unfolded,wlc,{0.39e-9,28e-9}" -k "folded,unfolded,bell,{%g,%g}" -q folded')) - parser.add_option("-p","--initial-params", dest="initial_params", - metavar="PARAMS", - help="Initial params for fitting (%default).", + parser.add_option('-p','--initial-params', dest='initial_params', + metavar='PARAMS', + help='Initial params for fitting (%default).', default='3.3e-4,0.25e-9') - parser.add_option("-r","--param-range", dest="param_range", - metavar="PARAMS", - help="Param range for plotting (%default).", + parser.add_option('-r','--param-range', dest='param_range', + metavar='PARAMS', + help='Param range for plotting (%default).', default='[1e-5,1e-3,20],[0.1e-9,1e-9,20]') - parser.add_option("--logx", dest="logx", - help="Use a log scale for the x range.", - default=False, action="store_true") - parser.add_option("--logy", dest="logy", - help="Use a log scale for the y range.", - default=False, action="store_true") - parser.add_option("-R","--residual", dest="residual", - metavar="STRING", - help="Residual type (from %s; default: %%default)." + parser.add_option('--logx', dest='logx', + help='Use a log scale for the x range.', + default=False, action='store_true') + parser.add_option('--logy', dest='logy', + help='Use a log scale for the y range.', + default=False, action='store_true') + parser.add_option('-R','--residual', dest='residual', + metavar='STRING', + help='Residual type (from %s; default: %%default).' % ', '.join(Histogram().types()), default='jensen-shannon') - parser.add_option("-P","--plot-residuals", dest="plot_residuals", - help="Generate residual difference plots for each point in the plot range.", - default=False, action="store_true") - parser.add_option("-c","--contour-plot", dest="contour_plot", - help="Select contour plot (vs. the default pseudocolor plot).", - default=False, action="store_true") + parser.add_option('-P','--plot-residuals', dest='plot_residuals', + help='Generate residual difference plots for each point in the plot range.', + default=False, action='store_true') + parser.add_option('-c','--contour-plot', dest='contour_plot', + help='Select contour plot (vs. the default pseudocolor plot).', + default=False, action='store_true') options,args = parser.parse_args(argv) diff --git a/pysawsim/sawsim.py b/pysawsim/sawsim.py index a8c55fc..92db883 100644 --- a/pysawsim/sawsim.py +++ b/pysawsim/sawsim.py @@ -86,32 +86,32 @@ class SawsimRunner (object): """ optparse_options = [ - Option("-s","--sawsim", dest="sawsim", - metavar="PATH", - help="Set sawsim binary (%default).", + Option('-s','--sawsim', dest='sawsim', + metavar='PATH', + help='Set sawsim binary (%default).', default=SAWSIM), - Option("-p","--params", dest="param_string", - metavar="PARAMS", - help="Initial params for fitting (%default).", + Option('-p','--params', dest='param_string', + metavar='PARAMS', + help='Initial params for fitting (%default).', default=DEFAULT_PARAM_STRING), - Option("-N", "--number-of-runs", dest="N", - metavar="INT", type='int', - help="Number of sawsim runs at each point in parameter space (%default).", + Option('-N', '--number-of-runs', dest='N', + metavar='INT', type='int', + help='Number of sawsim runs at each point in parameter space (%default).', default=400), - Option("-m", "--manager", dest="manager", - metavar="STRING", - help="Job manager name (one of %s) (%%default)." + Option('-m', '--manager', dest='manager', + metavar='STRING', + help='Job manager name (one of %s) (%%default).' % (', '.join(MANAGERS)), default=MANAGERS[0]), - Option("-C","--use-cache", dest="use_cache", - help="Use cached simulations if they exist (vs. running new simulations) (%default)", - default=False, action="store_true"), - Option("--clean-cache", dest="clean_cache", - help="Remove previously cached simulations if they exist (%default)", - default=False, action="store_true"), - Option("-d","--cache-dir", dest="cache_dir", - metavar="STRING", - help="Cache directory for sawsim unfolding forces (%default).", + Option('-C','--use-cache', dest='use_cache', + help='Use cached simulations if they exist (vs. running new simulations) (%default)', + default=False, action='store_true'), + Option('--clean-cache', dest='clean_cache', + help='Remove previously cached simulations if they exist (%default)', + default=False, action='store_true'), + Option('-d','--cache-dir', dest='cache_dir', + metavar='STRING', + help='Cache directory for sawsim unfolding forces (%default).', default=CACHE_DIR), ] diff --git a/pysawsim/sawsim_histogram.py b/pysawsim/sawsim_histogram.py index 3001fd8..3220ba4 100644 --- a/pysawsim/sawsim_histogram.py +++ b/pysawsim/sawsim_histogram.py @@ -66,9 +66,9 @@ def main(argv=None): parser = OptionParser(usage, epilog=epilog) for option in sr.optparse_options: parser.add_option(option) - parser.add_option("-w", "--bin-width", dest="bin_width", - metavar="FLOAT", type='float', - help="Histogram bin width in newtons (%default).", + parser.add_option('-w', '--bin-width', dest='bin_width', + metavar='FLOAT', type='float', + help='Histogram bin width in newtons (%default).', default=10e-12) options,args = parser.parse_args(argv)