diff --git a/xfel_calibrate/calibrate.py b/xfel_calibrate/calibrate.py index 9ca0315a27f3b4a2cfe8ba6c70cbd5d9cae9d193..a5e552ff86e68ac3b58610a68a4e6960c31e387f 100755 --- a/xfel_calibrate/calibrate.py +++ b/xfel_calibrate/calibrate.py @@ -377,7 +377,7 @@ def add_args_from_nb(nb, parser, cvar=None, overwrite_reqs=False): ltype = p.type range_allowed = "RANGE ALLOWED" in p.comment.upper() if p.comment else False - pars_group.add_argument("--{}".format(consolize_name(p.name)), + pars_group.add_argument(f"--{consolize_name(p.name)}", nargs='+', type=ltype if not range_allowed else str, default=default, @@ -387,18 +387,18 @@ def add_args_from_nb(nb, parser, cvar=None, overwrite_reqs=False): elif p.type == bool: # For a boolean, make --XYZ and --no-XYZ options. alt_group = pars_group.add_mutually_exclusive_group(required=required) - alt_group.add_argument("--no-{}".format(consolize_name(p.name)), - action="store_false", + alt_group.add_argument(f"--{consolize_name(p.name)}", + action="store_true", default=default, help=helpstr, dest=p.name) - alt_group.add_argument("--{}".format(consolize_name(p.name)), - action="store_true", + alt_group.add_argument(f"--no-{consolize_name(p.name)}", + action="store_false", default=default, - help=helpstr, + help=f"Opposite of --{consolize_name(p.name)}", dest=p.name) else: - pars_group.add_argument("--{}".format(consolize_name(p.name)), + pars_group.add_argument(f"--{consolize_name(p.name)}", type=p.type, default=default, help=helpstr,