Skip to content

Commit 57a9711

Browse files
committed
add count
1 parent d058a10 commit 57a9711

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

lib/database/repositories/QcFlagRepository.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,9 @@ class QcFlagRepository extends Repository {
117117
COUNT(DISTINCT qcf.id) = COUNT( DISTINCT gaqd.detector_id),
118118
qc_flag_block_significance(qcft.bad, qcft.monte_carlo_reproducible),
119119
NULL) AS significance,
120-
GROUP_CONCAT( DISTINCT qcfv.flag_id ) AS verified_flags_list,
121-
GROUP_CONCAT( DISTINCT qcfep.flag_id ) AS flags_list
120+
GROUP_CONCAT( DISTINCT qcfv.flag_id ) AS verified_flags_list,
121+
GROUP_CONCAT( DISTINCT qcfep.flag_id ) AS flags_list,
122+
COUNT(DISTINCT gaqd.detector_id) - COUNT(DISTINCT qcf.id) AS undefined_quality_periods_count,
122123
123124
FROM gaq_periods
124125
@@ -152,7 +153,8 @@ class QcFlagRepository extends Repository {
152153
qc_flag_block_significance_coverage(gaq.significance, coverage_ratio, 'mcr') AS mcr_coverage,
153154
qc_flag_block_significance_coverage(gaq.significance, coverage_ratio, 'good') AS good_coverage,
154155
GROUP_CONCAT(verified_flags_list) AS verified_flags_list,
155-
GROUP_CONCAT(flags_list) AS flags_list
156+
GROUP_CONCAT(flags_list) AS flags_list,
157+
SUM(undefined_quality_periods_count) AS undefined_quality_periods_count
156158
157159
FROM (${blockAggregationQuery}) AS gaq
158160
GROUP BY gaq.data_pass_id, gaq.run_number;
@@ -166,6 +168,7 @@ class QcFlagRepository extends Repository {
166168
good_coverage,
167169
flags_list,
168170
verifiedd_flags_list,
171+
undefined_quality_periods_count,
169172
}) => [
170173
run_number,
171174
{
@@ -174,6 +177,7 @@ class QcFlagRepository extends Repository {
174177
goodCoverage: parseFloat(good_coverage ?? '0'),
175178
flagsIds: [...new Set(flags_list?.split(','))],
176179
verifiedFlagsIds: [...new Set(verifiedd_flags_list?.split(','))],
180+
undefinedQualityPeriodsCount: undefined_quality_periods_count,
177181
},
178182
],
179183
);

lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,11 @@ export const RunsPerDataPassOverviewPage = ({
187187
format: (_, { runNumber }) => {
188188
const runGaqSummary = gaqSummary[runNumber];
189189
const FULL_COVERAGE = 1;
190+
const coverageEpsilon = 1e-6;
190191
const totalCoverage = (runGaqSummary?.badEffectiveRunCoverage ?? 0) +
191192
(runGaqSummary?.explicitlyNotBadEffectiveRunCoverage ?? 0);
192193

193-
const gaqDisplay = totalCoverage == FULL_COVERAGE
194+
const gaqDisplay = totalCoverage >= FULL_COVERAGE - coverageEpsilon
194195
? getQcSummaryDisplay(runGaqSummary)
195196
: h('button.btn.btn-primary.w-100', 'GAQ');
196197

lib/server/services/qualityControlFlag/GaqService.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class GaqService {
5757
goodCoverage,
5858
flagsIds,
5959
verifiedFlagsIds,
60+
undefinedQualityPeriodsCount,
6061
},
6162
]) => [
6263
runNumber,
@@ -65,6 +66,7 @@ class GaqService {
6566
[QcSummarProperties.explicitlyNotBadEffectiveRunCoverage]: goodCoverage + (mcReproducibleAsNotBad ? mcReproducibleCoverage : 0),
6667
[QcSummarProperties.mcReproducible]: mcReproducibleCoverage > 0,
6768
[QcSummarProperties.missingVerificationsCount]: flagsIds.length - verifiedFlagsIds.length,
69+
undefinedQualityPeriodsCount,
6870
},
6971
]);
7072

0 commit comments

Comments
 (0)