Fix Version/s: None
Sprint:Science Pipelines DM-W15-4, Science Pipelines DM-S15-1, DRP S17-3
Team:Data Release Production
The SourceDetectionTask always adds "flags.negative" to the schema (if provided) but it is only used if config.thresholdParity == "both".
As adding a field to a schema requires that the table passed to the run method have that field this is a significant nuisance when reusing the task. Please change the code to only modify the schema if it's going to set it.
Hmm, I guess I am, but not intentionally. This ticket was about keeping it the responsibility of SourceDetectionTask, and I think that that requires the logic that was in the original ticket.
I'd be OK with the background code calling SourceDetectionTask with schema==None instead.
Ok, letting schema=None be valid in all cases and adding the flag field to the schema if and only if schema is not None and thresholdPolarity="both" sounds like the easiest way forward here.
I followed the last suggestion, though it was not clear to me that the flag should be set for thresholdPolarity=="negative".
Very short review of tickets/
DM-903 on meas_algorithms: detection.py
Looks good! Sorry the review took me so long.
Not creating the flag for thresholdPolarity=='negative' seems correct to me - in that case all objects would have the same flag set, and hence it'd be pointless. In any case I think detecting only negative objects is quite rare; I'd be surprised if we use it all in production.
Right now the SourceDetectionTask constructor is responsible for adding flags_negative to the schema. So your proposal is that we make that the responsibility of the caller?