class_docstr: AbstractSampler base class for optimizer-directed samplers
      
docstr: Args:
    bounds (list[tuples]): (lower,upper) bound for each model input
    model (function): ``y = model(x)``, where ``x`` is an input parameter vector
    npts (int, default=None): number of points to sample the model
    **kwds (dict, default={}): keywords for the underlying ensemble of solvers;
      ``(evalmon, stepmon, maxiter, maxfun, dist, saveiter, state, termination,
      constraints, penalty, reducer, solver, id, map, tightrange, cliprange)``
      are available for use. See ``mystic.ensemble`` for more details.
          
code: def __init__(self, bounds, model, npts=None, **kwds):
      """
      Args:
        bounds (list[tuples]): (lower,upper) bound for each model input
        model (function): ``y = model(x)``, where ``x`` is an input parameter vector
        npts (int, default=None): number of points to sample the model
        **kwds (dict, default={}): keywords for the underlying ensemble of solvers;
          ``(evalmon, stepmon, maxiter, maxfun, dist, saveiter, state, termination,
          constraints, penalty, reducer, solver, id, map, tightrange, cliprange)``
          are available for use. See ``mystic.ensemble`` for more details.
      """  # FIXME: added 'id' and 'map'
      self._bounds = bounds
      self._model = model  # FIXME: if None, interpolate
      self._npts = npts
  
      self._evalmon = kwds.pop("evalmon", None)
      if self._evalmon is None:
          from mystic.monitors import Null
  
          self._evalmon = Null()
      from collections import defaultdict
  
      self._kwds = defaultdict(lambda: None)
      self._kwds.update(kwds)
  
      s = self._init_solver()
      kwd = dict(
          tight=self._kwds["tightrange"], clip=self._kwds["cliprange"]
      )
      s.SetStrictRanges(*zip(*bounds), **kwd)
      # s.SetObjective(memo) #model) #XXX: ExtraArgs: axis ???
      s.SetObjective(model)  # FIXME: ensure cached model
  
      # apply additional kwds
      solver = self._kwds["solver"]
      if solver is not None:
          s.SetNestedSolver(solver)
      s.id = self._kwds["id"]
      s.SetDistribution(self._kwds["dist"])
      s.SetEvaluationLimits(self._kwds["maxiter"], self._kwds["maxfun"])
      s.SetSaveFrequency(self._kwds["saveiter"], self._kwds["state"])
      termination = self._kwds["termination"]
      if termination is not None:
          s.SetTermination(termination)  # XXX:?
      s.SetConstraints(self._kwds["constraints"])
      s.SetPenalty(self._kwds["penalty"])
      s.SetReducer(self._kwds["reducer"], arraylike=True)
      s.SetGenerationMonitor(
          self._kwds["stepmon"]
      )  # XXX: use self._stepmon?
      mapper = self._kwds["map"]
      if mapper is not None:
          s.SetMapper(mapper)
      # TODO: close/join/clear after Solve?
  
      # pass a copy of the monitor to all instances
      import copy
  
      m = copy.deepcopy(
          self._evalmon
      )  # XXX: no change with direct reference
      s.SetEvaluationMonitor(m)
      self._sampler = s
      self._npts = s._npts
  
      self._evals = [0] * s._npts  # XXX: collect count or monitor?
      self._iters = [0] * s._npts  # XXX: collect count or monitor?
      return
  
file_path: mystic/mystic/abstract_sampler.py
label_desc: Use image node_id 1 to create a new AbstractSampler object from inherited base classes: object with example: obj = AbstractSampler(bounds, model, npts)