def makeMeasurement(self, values): """Compute the number of non-updated DIAObjects. Parameters ---------- values : sequence [`dict` [`str`, `int` or `None`]] A list where each element corresponds to a metadata object passed to `run`. Each `dict` has the following keys: ``"updatedObjects"`` The number of DIAObjects updated for this image (`int` or `None`). May be `None` if the image was not successfully associated. ``"unassociatedObjects"`` The number of DIAObjects not associated with a DiaSource in this image (`int` or `None`). May be `None` if the image was not successfully associated. Returns ------- measurement : `lsst.verify.Measurement` or `None` The total number of unassociated objects. """ nUpdated = 0 nUnassociated = 0 associated = False for value in values: if value["updatedObjects"] is not None \ and value["unassociatedObjects"] is not None: try: nUpdated += value["updatedObjects"] nUnassociated += value["unassociatedObjects"] except TypeError as e: raise MetricComputationError( "Corrupted value of numUpdatedDiaObjects " "or numUnassociatedDiaObjects") from e associated = True if associated: if nUpdated <= 0 and nUnassociated <= 0: raise MetricComputationError( "No pre-existing DIAObjects; can't compute updated fraction." ) else: fraction = nUpdated / (nUpdated + nUnassociated) return Measurement(self.getOutputMetricName(self.config), fraction * u.dimensionless_unscaled) else: self.log.info("Nothing to do: no association results found.") return None