From 0bfc4b4fa744a753ae3ee6da15495e8dcc222c07 Mon Sep 17 00:00:00 2001 From: Runzhong Wang <18309862+rogerwwww@users.noreply.github.com> Date: Mon, 21 Sep 2026 12:37:54 -0400 Subject: [PATCH] Fail when no DAG entries match --- data_scripts/dag/add_dag_intens.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/data_scripts/dag/add_dag_intens.py b/data_scripts/dag/add_dag_intens.py index 72a4fe2d..09382421 100644 --- a/data_scripts/dag/add_dag_intens.py +++ b/data_scripts/dag/add_dag_intens.py @@ -290,18 +290,11 @@ def write_func(outs): out_db.close() if len(arg_dicts) == 0: - print( - f"No matching entries found for pred DAGs ({pred_dag_path}) and true DAGs ({true_dag_path}). " - f"Creating empty output at {out_dag_path}." + raise ValueError( + f"No matching entries found for pred DAGs ({pred_dag_path}) and " + f"true DAGs ({true_dag_path}). Verify that spectrum IDs and " + "collision energies use matching conventions." ) - if args.magma_output: - out_h5 = common.HDF5Dataset(out_dag_path, mode='w') - out_h5.close() - else: - out_db = common.PredSpecDB(out_dag_path, mode='w') - out_db.close() - print("success!") - return # Run wrapper_fn = lambda arg_dict: relabel_tree(**arg_dict)