Handling empty table in PyGRB#5026
Merged
pannarale merged 6 commits intogwastro:masterfrom Jan 30, 2025
Merged
Conversation
titodalcanton
approved these changes
Jan 30, 2025
Contributor
titodalcanton
left a comment
There was a problem hiding this comment.
Looks good, but I have some suggestions that may make this code better.
Co-authored-by: Tito Dal Canton <tito@dalcanton.it>
Co-authored-by: Tito Dal Canton <tito@dalcanton.it>
khunsang
pushed a commit
to khunsang/pycbc
that referenced
this pull request
May 23, 2025
* Empty tables fixes * Fix table when there are no loud offsource triggers * First review comment * Update bin/pygrb/pycbc_pygrb_page_tables Co-authored-by: Tito Dal Canton <tito@dalcanton.it> * Second set of review comment * Update bin/pygrb/pycbc_pygrb_page_tables Co-authored-by: Tito Dal Canton <tito@dalcanton.it> --------- Co-authored-by: Tito Dal Canton <tito@dalcanton.it>
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR enables the production of tables, within PyGRB, when the table needs to be empty.
Standard information about the request
This is a: new feature
This change affects: PyGRB
This change changes: result presentation
Motivation
The current version of
pycbc_pygrb_page_tables(designed to handle missed/vetoed injections and loudest events) will not work when there is no injection/trigger to be displayed.Contents
This PR fixes this issue. The script no longer assumes there are injections to be displayed; further, it checks whether there is an onsource trigger to be reported: if there is not, the h5 file will be empty, where as the html file will say "There are no events" in the first column and report "-" in the remaining columns, to leave a human readable message.
Testing performed
The functioning of this can be checked in sections 3.01, 3.03, and 6 of this webpage.
Additional notes
The code to handle the case in which the offsource yields no triggers is along the lines of the one implemented for the injections, but admittedly it is not tested in this run.