code: def corner_grid(self):
          
          minmax_vecs = []
          for axis in range(self.ndim):
              if self.shape[axis] == 1:
                  minmax_vecs.append(self.coord_vectors[axis][0])
              else:
                  minmax_vecs.append((self.coord_vectors[axis][0],
                                      self.coord_vectors[axis][-1]))
  
          return RectGrid(*minmax_vecs)
docs: Return a grid with only the corner points.
  
          Returns
          -------
          cgrid : `RectGrid`
              Grid with size 2 in non-degenerate dimensions and 1
              in degenerate ones
  
          Examples
          --------
          >>> g = RectGrid([0, 1], [-1, 0, 2])
          >>> g.corner_grid()
          uniform_grid([ 0., -1.], [ 1.,  2.], (2, 2))