class_docstr: Vectorized slice/HARM sampler.
  
  Can revert until all previous steps have likelihoods allL above Lmin.
  Updates currentt, generation and allL, in-place.
docstr: Initialise.
  
  Parameters
  ----------
  popsize: int
      number of walkers to maintain
  nsteps: int
      number of steps to take until the found point is accepted as independent.
  generate_direction: function `(u, region, scale) -> v`
      function such as `generate_unit_directions`, which
      generates a random slice direction.
  scale: float
      initial guess scale for the length of the slice
  scale_adapt_factor: float
      smoothing factor for updating scale.
      if near 1, scale is barely updating, if near 0,
      the last slice length is used as a initial guess for the next.
docstr_tok: ["Initialise",".","Parameters","--","--","--","--","--","popsize",":","int","number","of","walkers","to","maintain","nsteps",":","int","number","of","steps","to","take","until","the","found","point","is","accepted","as","independent",".","generate_direction",":","function","`","(","u",",","region",",","scale",")","-",">","v","`","function","such","as","`","generate_unit_directions","`",",","which","generates","a","random","slice","direction",".","scale",":","float","initial","guess","scale","for","the","length","of","the","slice","scale_adapt_factor",":","float","smoothing","factor","for","updating","scale",".","if","near","1",",","scale","is","barely","updating",",","if","near","0",",","the","last","slice","length","is","used","as","a","initial","guess","for","the","next","."]
code: def __init__(
      self,
      popsize,
      nsteps,
      generate_direction,
      scale=1.0,
      scale_adapt_factor=0.9,
      log=False,
      logfile=None,
  ):
      """Initialise.
  
      Parameters
      ----------
      popsize: int
          number of walkers to maintain
      nsteps: int
          number of steps to take until the found point is accepted as independent.
      generate_direction: function `(u, region, scale) -> v`
          function such as `generate_unit_directions`, which
          generates a random slice direction.
      scale: float
          initial guess scale for the length of the slice
      scale_adapt_factor: float
          smoothing factor for updating scale.
          if near 1, scale is barely updating, if near 0,
          the last slice length is used as a initial guess for the next.
  
      """
      self.nsteps = nsteps
      self.nrejects = 0
      self.scale = scale
      self.scale_adapt_factor = scale_adapt_factor
      self.allu = []
      self.allL = []
      self.currentt = []
      self.currentv = []
      self.currentp = []
      self.generation = []
      self.current_left = []
      self.current_right = []
      self.searching_left = []
      self.searching_right = []
      self.ringindex = 0
  
      self.log = log
      self.logfile = logfile
  
      self.popsize = popsize
      self.generate_direction = generate_direction
  
imports: import numpy
  from ultranest.utils import submasks
  from ultranest.stepfuncs import evolve, step_back
  from ultranest.stepfuncs import generate_cube_oriented_direction, generate_cube_oriented_direction_scaled
  from ultranest.stepfuncs import generate_random_direction, generate_region_oriented_direction, generate_region_random_direction
  from ultranest.stepfuncs import generate_differential_direction, generate_mixture_random_direction
  import scipy.stats
label_desc: Use image node_id 1 to create a new PopulationSliceSampler object  with example: obj = PopulationSliceSampler(popsize, nsteps, generate_direction, scale, scale_adapt_factor, log, logfile)