Created
September 25, 2011 19:51
-
-
Save taldcroft/1241055 to your computer and use it in GitHub Desktop.
Template argparse configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_options(): | |
parser = argparse.ArgumentParser() | |
parser.add_argument("filename", | |
help="Model file") | |
parser.add_argument("--days", | |
type=float, | |
default=15, | |
help="Number of days in fit interval (default=90") | |
parser.add_argument("--stop", | |
help="Stop time of fit interval (default=model values)") | |
parser.add_argument("--nproc", | |
default=0, | |
type=int, | |
help="Number of processors (default=1)") | |
parser.add_argument("--fit-method", | |
default="simplex", | |
help="Sherpa fit method (simplex|moncar|levmar)") | |
parser.add_argument("--inherit-from", | |
help="Inherit par values from model spec file") | |
parser.add_argument("--quiet", | |
default=False, | |
action='store_true', | |
help="Suppress screen output") | |
return parser.parse_args() | |
opt = get_options() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment