docs: def diff(self, y, h, deriv, dim, coefs):
          """The core function to take a partial derivative on a uniform grid.
          """
  
          try:
              npts = y.shape[dim]
          except AttributeError as err:
              raise ValueError("FinDiff objects can only be applied to arrays or evaluated(!) functions returning arrays") from err
  
          scheme = "center"
          weights = coefs[scheme]["coefficients"]
          offsets = coefs[scheme]["offsets"]
  
          nbndry = len(weights) // 2
          ref_slice = slice(nbndry, npts - nbndry, 1)
          off_slices = [self._shift_slice(ref_slice, offsets[k], npts) for k in range(len(offsets))]
  
          yd = np.zeros_like(y)
  
          self._apply_to_array(yd, y, weights, off_slices, ref_slice, dim)
  
          scheme = "forward"
          weights = coefs[scheme]["coefficients"]
          offsets = coefs[scheme]["offsets"]
  
          ref_slice = slice(0, nbndry, 1)
          off_slices = [self._shift_slice(ref_slice, offsets[k], npts) for k in range(len(offsets))]
  
          self._apply_to_array(yd, y, weights, off_slices, ref_slice, dim)
  
          scheme = "backward"
          weights = coefs[scheme]["coefficients"]
          offsets = coefs[scheme]["offsets"]
  
          ref_slice = slice(npts - nbndry, npts, 1)
          off_slices = [self._shift_slice(ref_slice, offsets[k], npts) for k in range(len(offsets))]
  
          self._apply_to_array(yd, y, weights, off_slices, ref_slice, dim)
  
          h_inv = 1. / h ** deriv
          return yd * h_inv