docs: def sum_shapes(self, data1, data2):
          """
          Return the shapes of the summation arrays,
          given the input data and shape of the bins
          """
          # the linear shape (put extra dimensions first)
          linearshape = [-1] + list(self.shape)
  
          # determine the full shape
          subshapes = [list(d.subshape) for d in [data1, data2] if isinstance(d, field)]
          subshape = []
          if len(subshapes) == 2:
              assert subshapes[0] == subshapes[1]
              subshape = subshapes[0]
          elif len(subshapes) == 1:
              subshape = subshapes[0]
          fullshape = subshape + list(self.shape)
  
          # prepend the shape for different channels
          if self.channels:
              fullshape = [len(self.channels)] + fullshape
  
          return linearshape, fullshape