-
Notifications
You must be signed in to change notification settings - Fork 348
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
Starting expansion of PyGRB post-processing workflow generator #4891
Conversation
…a better landing page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main question is about the File in FileList
function. I would like to understand what this is testing and would like it moved to a method of a FileList class (unless this is doing something very specific/odd or the functionality already exists).
bin/pygrb/pycbc_pygrb_pp_workflow
Outdated
@@ -43,6 +43,48 @@ __date__ = pycbc.version.date | |||
__program__ = "pycbc_pygrb_pp_workflow" | |||
|
|||
|
|||
# Function used to retrive a File instance from a FileList based on an | |||
# injection set label | |||
def fish_label_in_filelist(label, filelist): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function doesn't belong here. It should be a method in the FileList class (in core.py). BUT first, does the functionality desired already exist?
Are you basically asking here if label
is a tag
in the file? (Note that using the file name
is dangerous and should not be done, checking the attributes is better). If so, this exists:
https://github.com/gwastro/pycbc/blob/master/pycbc/workflow/core.py#L1549
if not, can you elaborate on what label is (or what the file attributes are, to figure out how it decides this).
I followed the suggestions above, adopting the solutions discussed privately. The webpage and all its contents were successfully regenerated here. |
Adding two utils functions within
pycbc_pygrb_pp_workflow
and (re)designing the opening page for a PyGRB results webpage.Motivation
This PR continues work started with #4872 to breakdown the workflow changes that produce a complete PyGRB results page. It is the first of a series of PRs that affects
pycbc_pygrb_pp_workflow
.Standard information about the request
This is a: the beginning of work to allow an end-to-end PyGRB run from master, with all results displayed in the final webpage.
This change affects: PyGRB
This change changes: result presentation / plotting.
Contents
The two new utility functions are:
fish_label_in_filelist
– This is needed to retrive a specific injections resultsFile
, given the injection set label. E.g., when a plot for "NSBH" injections is being produce, the "NSBH" injections resultsFile
needs to be pinpointed among all injections results files in aFileList
. The function returns theFile
, but we could think of returning a dictionary{injection set label: corresponding File}
so that wefilter
theFileList
once and for all rather than anytime results for and injections set are needed. Or something completely different: I am happy to hear suggestions from the PR reviewer.display_seg_plot
– The PyGRB segments plot is produced in preprocessing. I would like the results webpage to display this in the opening page, so this function retrieves it and add metadata to it (prior to sticking it on the opening page). The metadata is added here because the current preprocessing code does not usesave_fig_with_metadata
for this plot, nor a stand alone executable to produce it. Since PyGRB will have to undergo a pretty large review, I am currently staying away from touching the old and already reviewed preprocessing material. In the longer term, the clean solution I have in mind is to add the capability to display the PyGRB offsource and external trigger time on top of the standard all-sky segments plot; then it would be a matter of retrieving thatFile
without the need fordisplay_seg_plot
The rest of the changes simply organise the layout of the landing page.
Testing performed
The complete set of changes will produce the end result linked above, but the single PRs will enable only part of it ad do not have stand alone examples/tests.
Additional notes
The PRs that will come up after this one will "just" add tabs and sections to the results webpage and fill them up. These are the only 2 functions that were added.