Skip to content

Commit 539616d

Browse files
committed
wip
1 parent 1f963b2 commit 539616d

3 files changed

Lines changed: 16 additions & 7 deletions

File tree

lib/domain/dtos/filters/RunFilterDto.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@ exports.RunFilterDto = Joi.object({
120120

121121
detectorsQc: Joi.object()
122122
.pattern(
123-
Joi.string().regex(/^_\d+$/),
123+
Joi.string().regex(/^_\d+$/), // Detector id prefixed with '_'
124124
Joi.object({ notBadFraction: FloatComparisonDto }),
125125
)
126126
.keys({
127127
mcReproducibleAsNotBad: Joi.boolean().optional(),
128128
})
129129
.custom((value, helpers) => {
130130
const [{ dataPassIds, simulationPassIds, lhcPeriodIds }] = helpers.state.ancestors;
131-
const filters = [dataPassIds, simulationPassIds, lhcPeriodIds].filter((x) => Array.isArray(x) && x.length === 1);
131+
const filters = [dataPassIds, simulationPassIds, lhcPeriodIds].filter(({ length }) => length === 1);
132132

133133
if (filters.length !== 1 && Object.keys(value).some((k) => /^_\d+$/.test(k))) {
134134
return helpers.error('any.invalid', {

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ export class RunsPerDataPassOverviewModel extends FixedPdpBeamTypeRunsOverviewMo
3535
super(model);
3636
this._detectors$ = detectorsProvider.qc$;
3737
this._detectors$.bubbleTo(this);
38+
this._detectors$.observe((observableData) => observableData.getCurrent().apply({
39+
Success: (detectors) => detectors.forEach(({ id }) => {
40+
this._filteringModel.put(`detectorsQC[_${id}][notBadFraction]`, new NumericalComparisonFilterModel({
41+
scale: 0.1,
42+
integer: false,
43+
}));
44+
}),
45+
}));
3846
this._dataPass = new ObservableData(RemoteData.notAsked());
3947
this._dataPass.bubbleTo(this);
4048
this._qcSummary$ = new ObservableData(RemoteData.notAsked());

lib/usecases/run/GetAllRunsUseCase.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,6 @@ class GetAllRunsUseCase {
358358
}
359359

360360
const badEffectiveRunCoverageComparison = (badEffectiveRunCoverage, operator, value) => {
361-
console.log(badEffectiveRunCoverage, operator, value)
362361
switch (operator) {
363362
case '<':
364363
return 1 - badEffectiveRunCoverage < value;
@@ -400,10 +399,14 @@ class GetAllRunsUseCase {
400399
delete detectorsQc.operator;
401400

402401
const qcSummary = await qcFlagSummaryService.getSummary(
403-
{ dataPassId, simulationPassId, lhcPeriodId, dplDetectorIds: Object.keys(detectorsQc).map((id) => parseInt(id.slice(1), 10)) },
402+
{
403+
dataPassId,
404+
simulationPassId,
405+
lhcPeriodId,
406+
dplDetectorIds: Object.keys(detectorsQc).map((id) => parseInt(id.slice(1), 10)),
407+
},
404408
{ mcReproducibleAsNotBad },
405409
);
406-
console.log(qcSummary)
407410

408411
const runNumbers = Object.entries(qcSummary)
409412
.filter(([_, runSummary]) => {
@@ -414,14 +417,12 @@ class GetAllRunsUseCase {
414417
const { operator: forDetectorOperator, limit } = detectorsQc[`_${dplDetecotrId}`].notBadFraction;
415418
return badEffectiveRunCoverageComparison(badEffectiveRunCoverage, forDetectorOperator, limit);
416419
});
417-
console.log(mask)
418420
switch (operator) {
419421
case 'and': return mask.every((id) => id);
420422
case 'or': return mask.some((id) => id);
421423
}
422424
})
423425
.map(([runNumber]) => runNumber);
424-
console.log(runNumbers)
425426
filteringQueryBuilder.where('runNumber').oneOf(...runNumbers);
426427
}
427428

0 commit comments

Comments
 (0)