From f3708f28be74c62794a26fcac22f178b12597667 Mon Sep 17 00:00:00 2001 From: Shichao Wu Date: Wed, 11 Sep 2024 22:02:05 +0200 Subject: [PATCH] Update __init__.py --- pycbc/inference/io/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pycbc/inference/io/__init__.py b/pycbc/inference/io/__init__.py index 3157f4408f6..6451bcf2546 100644 --- a/pycbc/inference/io/__init__.py +++ b/pycbc/inference/io/__init__.py @@ -765,7 +765,12 @@ def injections_from_cli(opts): # loop over all input files getting the injection files for input_file in input_files: fp = loadfile(input_file, 'r') - these_injs = fp.read_injections() + cp = fp.read_config_file() + if cp.has_option('model', 'primary_model'): + primary_model_label = cp.get('model', 'primary_model') + these_injs = fp.read_injections(group='/%s' % primary_model_label) + else: + these_injs = fp.read_injections() # apply mapping if it was provided if param_map: mapvals = {sp: these_injs[ip] for ip, sp in param_map}