def METHOD_NAME(self, size):
    "Common measurement of accuracy and timings"
    t0 = time.time()
    if HAS_SCIPY:
        ref = median_filter(self.data, size, mode="nearest")
    else:
        ref = median_filter(self.data, size)
    t1 = time.time()
    try:
        got = self.medianfilter.medfilt2d(self.data, size)
    except RuntimeError as msg:
        logger.error(msg)
        return
    t2 = time.time()
    delta = abs(got - ref).max()
    return Result(size, delta, t1 - t0, t2 - t1)