From ac0b75aa2ab08956a72dfbb88d9f27117d751213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignasi=20P=C3=A9rez-R=C3=A0fols?= Date: Tue, 30 Aug 2022 10:50:14 +0200 Subject: [PATCH] improved error message --- bin/format_superset_dr12q.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/format_superset_dr12q.py b/bin/format_superset_dr12q.py index b03bb26..ace36af 100644 --- a/bin/format_superset_dr12q.py +++ b/bin/format_superset_dr12q.py @@ -126,14 +126,18 @@ def main(cmdargs): if args.qso_dataframe is not None: if ((args.qso_cat is not None) or (args.qso_specid is not None) or (args.qso_ztrue is not None)): - parser.error("options --qso-cat, --qso-cols, --qso-specid, and --qso-ztrue " \ - "are incompatible with --qso-dataframe") + parser.error("options --qso-cat, --qso-specid, and --qso-ztrue " + "are incompatible with --qso-dataframe. Found: " + f"--qso-cat {args.qso_cat} --qso-specid {args.qso_specid} " + f"--qso-ztrue {args.qso_ztrue}") quasar_catalogue = deserialize(load_json(args.qso_dataframe)) quasar_catalogue["LOADED"] = True else: if (args.qso_cat is None) or (args.qso_cols is None) or (args.qso_specid is None) or (args.qso_ztrue is None): parser.error("--qso-cat, --qso-cols, --qso-specid, and --qso-ztrue are " \ - "required if --qso-dataframe is not passed") + "required if --qso-dataframe is not passed. Found: " + f"--qso-cat {args.qso_cat} --qso-specid {args.qso_specid} " + f"--qso-ztrue {args.qso_ztrue}") quasar_catalogue = QuasarCatalogue(args.qso_cat, args.qso_cols, args.qso_specid, args.qso_ztrue, args.qso_hdu).quasar_catalogue()