-
Notifications
You must be signed in to change notification settings - Fork 21
[O2B-1528] Split GAQ summary requests #2071
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
base: main
Are you sure you want to change the base?
Changes from all commits
5e62f29
84aceda
7e1c0c4
67564ed
b8decec
9f122fe
a5768c7
89a09ee
f3533d0
f6edc96
d020ac8
e6e6388
58081a4
ccead8e
40f92b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,13 +44,14 @@ class GaqService { | |
| * @param {object} [options] additional options | ||
| * @param {boolean} [options.mcReproducibleAsNotBad = false] if set to true, | ||
| * `Limited Acceptance MC Reproducible` flag type is treated as good one | ||
| * @param {number} [options.runNumber] Optional run number to filter by | ||
| * @return {Promise<GaqSummary>} Resolves with the GAQ Summary | ||
| */ | ||
| async getSummary(dataPassId, { mcReproducibleAsNotBad = false } = {}) { | ||
| async getSummary(dataPassId, { mcReproducibleAsNotBad = false, runNumber } = {}) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dataPassId is not documented
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you elaborate? If you mean in terms of the JSDoc then it is there, at the top.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest you name runNumber something different, to differentiate it from the runNumber you're using in the map function
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I agree. |
||
| await getOneDataPassOrFail({ id: dataPassId }); | ||
| const gaqCoverages = await QcFlagRepository.getGaqCoverages(dataPassId); | ||
| const gaqCoverages = await QcFlagRepository.getGaqCoverages(dataPassId, runNumber); | ||
| const gaqSummary = Object.entries(gaqCoverages).map(([ | ||
| runNumber, | ||
| runNumberMapped, | ||
| { | ||
| badCoverage, | ||
| mcReproducibleCoverage, | ||
|
|
@@ -60,7 +61,7 @@ class GaqService { | |
| undefinedQualityPeriodsCount, | ||
| }, | ||
| ]) => [ | ||
| runNumber, | ||
| runNumberMapped, | ||
| { | ||
| [QcSummarProperties.BAD_EFFECTIVE_RUN_COVERAGE]: badCoverage + (mcReproducibleAsNotBad ? 0 : mcReproducibleCoverage), | ||
| [QcSummarProperties.EXPLICITELY_NOT_BAD_EFFECTIVE_RUN_COVERAGE]: | ||
|
|
@@ -71,6 +72,14 @@ class GaqService { | |
| }, | ||
| ]); | ||
|
|
||
| /** | ||
| * If runNumber is specified, only one summary is returned but the getGaqCoverages | ||
| * returns still with runNumber as key, so we extract the single value from the array. | ||
| */ | ||
| if (runNumber && gaqSummary.length === 1) { | ||
| return Object.fromEntries(gaqSummary)[runNumber]; | ||
| } | ||
|
|
||
| return Object.fromEntries(gaqSummary); | ||
| } | ||
|
|
||
|
|
||
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.
As you use observable data, you can already tell it what the source to look for is rather than doing it on L82
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.
I am not sure how to use it with the asynchronous nature of the summaries.