From c25f0e4e82dd1c5f5bac10188364e93b61f4a49b Mon Sep 17 00:00:00 2001 From: Francesco Pannarale Date: Wed, 11 Sep 2024 03:09:32 -0700 Subject: [PATCH 1/2] setup_pygrb_minifollowups cleaner --- pycbc/workflow/grb_utils.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/pycbc/workflow/grb_utils.py b/pycbc/workflow/grb_utils.py index 3ad2a4ddf4a..c30841b73d7 100644 --- a/pycbc/workflow/grb_utils.py +++ b/pycbc/workflow/grb_utils.py @@ -1,4 +1,4 @@ -# Copyright (C) 2015 Andrew Williamson +# Copyright (C) 2015 Andrew Williamson, Francesco Pannarale # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -661,10 +661,9 @@ def make_pygrb_injs_tables(workflow, out_dir, # exclude=None, require=None, # Based on setup_single_det_minifollowups -def setup_pygrb_minifollowups(workflow, followups_file, - dax_output, out_dir, - trig_file=None, tags=None): - """Create plots that followup the the loudest PyGRB triggers or +def setup_pygrb_minifollowups(workflow, followups_file, trigger_file, + dax_output, out_dir, tags=None): + """ Create plots that followup the the loudest PyGRB triggers or missed injections from an HDF file. Parameters @@ -672,8 +671,10 @@ def setup_pygrb_minifollowups(workflow, followups_file, workflow: pycbc.workflow.Workflow The core workflow instance we are populating followups_file: pycbc.workflow.File - The File class holding the triggers/injections. - dax_output: The directory that will contain the dax file. + The File class holding the triggers/injections to follow up + trigger_file: pycbc.workflow.File + The File class holding the triggers + dax_output: The directory that will contain the dax file out_dir: path The directory to store minifollowups result plots and files tags: {None, optional} @@ -690,7 +691,6 @@ def setup_pygrb_minifollowups(workflow, followups_file, return tags = [] if tags is None else tags - # _workflow.makedir(dax_output) makedir(dax_output) # Turn the config file into a File instance @@ -710,14 +710,12 @@ def setup_pygrb_minifollowups(workflow, followups_file, tags=tags) node = exe.create_node() + node.add_input_opt('--trig-file', resolve_url_to_file(trigger_file)) + # Grab and pass all necessary files - if trig_file is not None: - node.add_input_opt('--trig-file', trig_file) if workflow.cp.has_option('workflow', 'veto-files'): veto_files = build_veto_filelist(workflow) node.add_input_list_opt('--veto-files', veto_files) - trig_time = workflow.cp.get('workflow', 'trigger-time') - node.add_opt('--trigger-time', trig_time) node.add_input_opt('--config-files', config_file) node.add_input_opt('--followups-file', followups_file) node.add_opt('--wiki-file', wikifile) @@ -734,6 +732,7 @@ def setup_pygrb_minifollowups(workflow, followups_file, node.add_opt('--workflow-name', name) node.add_opt('--output-dir', out_dir) + node.add_opt('--dax-file-directory', '.') workflow += node From 904f1aed07056d765ec45aa1caeb2574d3aeecb4 Mon Sep 17 00:00:00 2001 From: Francesco Pannarale Date: Thu, 19 Sep 2024 08:25:19 -0700 Subject: [PATCH 2/2] Removing resolve_url_to_file from setup_pygrb_minifollowups --- pycbc/workflow/grb_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pycbc/workflow/grb_utils.py b/pycbc/workflow/grb_utils.py index c30841b73d7..f0db2f38f69 100644 --- a/pycbc/workflow/grb_utils.py +++ b/pycbc/workflow/grb_utils.py @@ -710,7 +710,7 @@ def setup_pygrb_minifollowups(workflow, followups_file, trigger_file, tags=tags) node = exe.create_node() - node.add_input_opt('--trig-file', resolve_url_to_file(trigger_file)) + node.add_input_opt('--trig-file', trigger_file) # Grab and pass all necessary files if workflow.cp.has_option('workflow', 'veto-files'):