def deserialize_ExperimentPoint(experiment, id_mappings, ioHelper): # coordinate_id = ioHelper.readId() # sampleCount = ioHelper.readInt() # mean = ioHelper.readValue() # meanCI_start = ioHelper.readValue() # meanCI_end = ioHelper.readValue() # standardDeviation = ioHelper.readValue() # median = ioHelper.readValue() # medianCI_start = ioHelper.readValue() # medianCI_end = ioHelper.readValue() # minimum = ioHelper.readValue() # maximum = ioHelper.readValue() # metricId = ioHelper.readId() # callpathId = ioHelper.readId() coordinate_id, sampleCount, \ mean, meanCI_start, meanCI_end, \ standardDeviation, \ median, medianCI_start, medianCI_end, \ minimum, maximum, metricId, callpathId = ioHelper.read_pattern('qqdddddddddqq') coordinate = id_mappings.coordinate_mapping[coordinate_id] metric = experiment.metrics[metricId] callpath = id_mappings.callpath_mapping[callpathId] point = Measurement(coordinate, callpath, metric, None) point.minimum = minimum point.maximum = maximum point.mean = mean point.median = median point.std = standardDeviation return point
def make_measurement(c, ms: Sequence[Measurement]): if len(ms) == 1: measurement = copy.copy(ms[0]) measurement.coordinate = Coordinate(c) return measurement measurement = Measurement(Coordinate(c), ms[0].callpath, ms[0].metric, None) if self.use_median: value = np.mean([m.median for m in ms]) else: value = np.mean([m.mean for m in ms]) measurement.mean = value measurement.median = value if measurement.mean == 0: measurement.maximum = np.mean([m.maximum for m in ms]) measurement.minimum = np.mean([m.minimum for m in ms]) measurement.std = np.mean([m.std for m in ms]) else: measurement.maximum = np.nanmean([m.maximum / m.mean for m in ms]) * measurement.mean measurement.minimum = np.nanmean([m.minimum / m.mean for m in ms]) * measurement.mean measurement.std = np.nanmean([m.std / m.mean for m in ms]) * measurement.mean return measurement