Skip to content
Snippets Groups Projects
Commit ea837c3f authored by Jameson Rollins's avatar Jameson Rollins
Browse files

small tweak to handling of --ifo parameter

simplify things a bit
parent 7b0a5366
No related branches found
No related tags found
No related merge requests found
...@@ -73,7 +73,7 @@ parser.add_argument( ...@@ -73,7 +73,7 @@ parser.add_argument(
'--freq', '-f', metavar='FLO:[NPOINTS:]FHI', '--freq', '-f', metavar='FLO:[NPOINTS:]FHI',
help="logarithmic frequency array specification in Hz [{}]".format(DEFAULT_FREQ)) help="logarithmic frequency array specification in Hz [{}]".format(DEFAULT_FREQ))
parser.add_argument( parser.add_argument(
'--ifo', '-o', metavar='PARAM=VAL', '--ifo', '-o', metavar='PARAM=VAL', default=[],
#nargs='+', action='extend', #nargs='+', action='extend',
action='append', action='append',
help="override budget IFO parameter (may be specified multiple times)") help="override budget IFO parameter (may be specified multiple times)")
...@@ -146,13 +146,12 @@ def main(): ...@@ -146,13 +146,12 @@ def main():
plot_style = getattr(budget, 'plot_style', {}) plot_style = getattr(budget, 'plot_style', {})
trace = None trace = None
if args.ifo: for paramval in args.ifo:
for paramval in args.ifo: try:
try: param, val = paramval.split('=', 1)
param, val = paramval.split('=', 1) ifo[param] = float(val)
ifo[param] = float(val) except ValueError:
except ValueError: parser.error(f"Improper IFO parameter specification: {paramval}")
parser.error("Improper IFO parameter specification.")
if args.yaml: if args.yaml:
if not ifo: if not ifo:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment