Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved pygrb missed/quiet injection tables job handler #4877

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

pannarale
Copy link
Contributor

@pannarale pannarale commented Sep 12, 2024

This PR improves how jobs are added to the PyGRB workflow to create tables with "quiet-found" and "missed-found injections". The function is (hopefully) cleaner and it handles its inputs more appropriately.

Standard information about the request

This is an improvement of an existing feature.

This change affects: PyGRB

This change changes: result presentation

Links to any issues or associated PRs

This change is the 4th PR of a series started with #4872. It should be the last one for grb_utils.py.

Testing performed

As for the previous 3 PRs, a complete webpage example is available here, but the full webpage will be reproducible only once all workflow changes are on master.

  • The author of this pull request confirms they will adhere to the code of conduct

@pannarale pannarale added the PyGRB PyGRB development label Sep 12, 2024
@pannarale pannarale self-assigned this Sep 12, 2024
Copy link
Contributor

@spxiwh spxiwh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request to consider using File objects to avoid potential failure modes. However, this will not hit the potential failure modes as written, so happy to not hold things up.

node = PlotExecutable(workflow.cp, exec_name,
ifos=workflow.ifos, out_dir=out_dir,
tags=tags+extra_tags).create_node()
# Pass the bank-file
node.add_input_opt('--bank-file', resolve_url_to_file(bank_file))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here with bank_file, pass File objects around, not URLs. There are potential failure modes with file handling here if resolve_url_to_file doesn't realise it is the same file every time.

# Pass the bank-file
node.add_input_opt('--bank-file', resolve_url_to_file(bank_file))
# Offsource input file (or equivalently trigger file for injections)
offsource_file = resolve_url_to_file(off_file)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here

'sngl-snr-threshold', 'null-grad-thresh', 'null-grad-val']:
if workflow.cp.has_option('workflow', opt):
node.add_opt('--'+opt, workflow.cp.get('workflow', opt))
seg_filelist = FileList([resolve_url_to_file(sf) for sf in seg_files])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here again

fm_file = configparser_value_to_file(workflow.cp,
'injections-'+inj_set,
'found-missed-file')
fm_file = resolve_url_to_file(inj_file)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would this not already be a file object here???

if on_file is not None:
src_type = 'onsource-trig'
# Onsource input file (passed as File instance)
onsource_file = resolve_url_to_file(on_file)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too.

@pannarale
Copy link
Contributor Author

@spxiwh, I followed up on your comments, thanks. I reran the post-processing portion of the run and successfully produced a new webpage which looks like the original one.

@pannarale pannarale merged commit bdfb15c into gwastro:master Sep 19, 2024
30 checks passed
@pannarale pannarale deleted the pygrb_injs_table_jobs branch September 19, 2024 16:38
@pannarale pannarale mentioned this pull request Sep 19, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PyGRB PyGRB development
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants