Skip to content

Commit 2446909

Browse files
committed
use undefined periods count
1 parent 57a9711 commit 2446909

3 files changed

Lines changed: 2 additions & 35 deletions

File tree

lib/database/repositories/QcFlagRepository.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class QcFlagRepository extends Repository {
119119
NULL) AS significance,
120120
GROUP_CONCAT( DISTINCT qcfv.flag_id ) AS verified_flags_list,
121121
GROUP_CONCAT( DISTINCT qcfep.flag_id ) AS flags_list,
122-
COUNT(DISTINCT gaqd.detector_id) - COUNT(DISTINCT qcf.id) AS undefined_quality_periods_count,
122+
COUNT(DISTINCT gaqd.detector_id) - COUNT(DISTINCT qcf.id) AS undefined_quality_periods_count
123123
124124
FROM gaq_periods
125125

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,8 @@ export const RunsPerDataPassOverviewPage = ({
186186
visible: true,
187187
format: (_, { runNumber }) => {
188188
const runGaqSummary = gaqSummary[runNumber];
189-
const FULL_COVERAGE = 1;
190-
const coverageEpsilon = 1e-6;
191-
const totalCoverage = (runGaqSummary?.badEffectiveRunCoverage ?? 0) +
192-
(runGaqSummary?.explicitlyNotBadEffectiveRunCoverage ?? 0);
193189

194-
const gaqDisplay = totalCoverage >= FULL_COVERAGE - coverageEpsilon
190+
const gaqDisplay = runGaqSummary?.undefinedQualityPeriodsCount === 0
195191
? getQcSummaryDisplay(runGaqSummary)
196192
: h('button.btn.btn-primary.w-100', 'GAQ');
197193

test/api/runs.test.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -399,33 +399,6 @@ module.exports = () => {
399399

400400
it('should successfully filter by GAQ notBadFraction', async () => {
401401
const dataPassId = 1;
402-
const runNumber = 107;
403-
const commonScopte = {
404-
runNumber,
405-
dataPassIdentifier: { id: dataPassId },
406-
};
407-
const relations = { user: { roles: ['admin'], externalUserId: 1 } };
408-
// eslint-disable-next-line require-jsdoc
409-
const t = (timeString) => new Date(`2019-08-08 ${timeString}`).getTime();
410-
const goodFlagTypeId = 3;
411-
const mcReproducibleFlagTypeId = 11;
412-
let createdFlagIds = [];
413-
414-
let flagIds = await qcFlagService.create(
415-
[{ from: null, to: null, flagTypeId: goodFlagTypeId }],
416-
{ ...commonScopte, detectorIdentifier: { detectorName: 'EMC' } },
417-
relations,
418-
);
419-
createdFlagIds = [...createdFlagIds, ...flagIds];
420-
421-
flagIds = await qcFlagService.create(
422-
[{ from: null, to: t('13:30:00'), flagTypeId: goodFlagTypeId }],
423-
[{ from: t('13:30:00'), to: null, flagTypeId: mcReproducibleFlagTypeId }],
424-
{ ...commonScopte, detectorIdentifier: { detectorName: 'CPV' } },
425-
relations,
426-
);
427-
createdFlagIds = [...createdFlagIds, ...flagIds];
428-
429402
{
430403
const response = await request(server).get(`/api/runs?filter[dataPassIds][]=${dataPassId}&filter[gaq][notBadFraction][<]=0.8`);
431404

@@ -445,8 +418,6 @@ module.exports = () => {
445418
expect(runs).to.be.an('array');
446419
expect(runs).to.have.lengthOf(0);
447420
}
448-
449-
await Promise.all(createdFlagIds.map((flagId) => qcFlagService.delete(flagId)));
450421
});
451422

452423
it('should return http status 400 if updatedAt from larger than to', async () => {

0 commit comments

Comments
 (0)