class_docstr: A tiny class to handle cartesian grids
class_docstr_tok: ["A","tiny","class","to","handle","cartesian","grids"]
docstr: Compute the grid points
  
  Returns
  -------
  grid: array of shape (nb_nodes, self.dim)
        where nb_nodes is the prod of self.n_bins
docstr_tok: ["Compute","the","grid","points","Returns","--","--","--","-","grid",":","array","of","shape","(","nb_nodes",",","self.dim",")","where","nb_nodes","is","the","prod","of","self.n_bins"]
code: def make_grid(self):
      """Compute the grid points
  
      Returns
      -------
      grid: array of shape (nb_nodes, self.dim)
            where nb_nodes is the prod of self.n_bins
      """
      size = np.prod(self.n_bins)
      grid = np.zeros((size, self.dim))
      grange = []
  
      for j in range(self.dim):
          xm = self.lim[2 * j]
          xM = self.lim[2 * j + 1]
          if np.isscalar(self.n_bins):
              xb = self.n_bins
          else:
              xb = self.n_bins[j]
          gr = xm + float(xM - xm) / (xb - 1) * np.arange(xb).astype(
              "f"
          )
          grange.append(gr)
  
      if self.dim == 1:
          grid = np.array([[grange[0][i]] for i in range(xb)])
  
      if self.dim == 2:
          for i in range(self.n_bins[0]):
              for j in range(self.n_bins[1]):
                  grid[i * self.n_bins[1] + j] = np.array(
                      [grange[0][i], grange[1][j]]
                  )
  
      if self.dim == 3:
          for i in range(self.n_bins[0]):
              for j in range(self.n_bins[1]):
                  for k in range(self.n_bins[2]):
                      q = (i * self.n_bins[1] + j) * self.n_bins[2] + k
                      grid[q] = np.array(
                          [grange[0][i], grange[1][j], grange[2][k]]
                      )
      if self.dim > 3:
          raise NotImplementedError(
              "only dimensions <4 are currently handled"
          )
      return grid
  
imports: import numpy
  from scipy.linalg import eigvalsh
label_desc: Use image node_id 3 for calling the GridDescriptor obj's underlying member method code with example usage: obj.make_grid() and returns: grid