def METHOD_NAME(xnew: Variable, *, midpoints=False) -> DataArray:
    """Compute interpolation function defined by ``interp1d``
    at interpolation points.
    :param xnew: Interpolation points.
    :param midpoints: Interpolate at midpoints of given points. The result will be
                      a histogram. Default is ``False``.
    :return: Interpolated data array with new coord given by interpolation points
             and data given by interpolation function evaluated at the
             interpolation points (or evaluated at the midpoints of the given
             points).
    """
    if xnew.unit != da.coords[dim].unit:
        raise UnitError(
            f"Unit of interpolation points '{xnew.unit}' does not match unit "
            f"'{da.coords[dim].unit}' of points defining the interpolation "
            "function along dimension '{dim}'."
        )
    if xnew.dim != dim:
        raise DimensionError(
            f"Dimension of interpolation points '{xnew.dim}' does not match "
            f"interpolation dimension '{dim}'"
        )
    f = inter.interp1d(
        x=_as_interpolation_type(da.coords[dim].values),
        y=da.values,
        kind=kind,
        fill_value=fill_value,
        **kwargs,
    )
    x_ = _as_interpolation_type(_midpoints(xnew, dim) if midpoints else xnew)
    sizes = da.sizes
    sizes[dim] = x_.sizes[dim]
    # ynew is created in this manner to allow for creation of structured dtypes,
    # which is not possible using scipp.array
    ynew = empty(sizes=sizes, unit=da.unit, dtype=da.dtype)
    ynew.values = f(x_.values)
    return DataArray(data=ynew, coords={dim: xnew})