class_docstr: Benchmark RegularGridInterpolator with method="linear".
class_docstr_tok: ["Benchmark","RegularGridInterpolator","with","method=","''","linear","''","."]
code: def setup(self, ndim, max_coord_size, n_samples, flipped):
      rng = np.random.default_rng(314159)
  
      # coordinates halve in size over the dimensions
      coord_sizes = [max_coord_size // 2**i for i in range(ndim)]
      self.points = [
          np.sort(rng.random(size=s))[::flipped] for s in coord_sizes
      ]
      self.values = rng.random(size=coord_sizes)
  
      # choose in-bounds sample points xi
      bounds = [(p.min(), p.max()) for p in self.points]
      xi = [
          rng.uniform(low, high, size=n_samples) for low, high in bounds
      ]
      self.xi = np.array(xi).T
  
      self.interp = RegularGridInterpolatorValues(
          self.points,
          self.xi,
      )
  
imports: import numpy
  from .common import run_monitored, set_mem_rlimit, Benchmark, safe_import
label_desc: Use image node_id 1 for calling the RegularGridInterpolatorSubclass obj's underlying member method code with example usage: obj.setup(ndim, max_coord_size, n_samples, flipped) without return types