class_docstr: Holds the param-space coordinates (X) and target values (Y)
  Allows for constant-time appends while ensuring no duplicates are added
  
  Example
  -------
  >>> def target_func(p1, p2):
  >>>     return p1 + p2
  >>> pbounds = {'p1': (0, 1), 'p2': (1, 100)}
  >>> space = TargetSpace(target_func, pbounds, random_state=0)
  >>> x = np.array([4 , 5])
  >>> y = target_func(x)
  >>> space.register(x, y)
  >>> assert self.max()['target'] == 9
  >>> assert self.max()['params'] == {'p1': 1.0, 'p2': 2.0}
class_docstr_tok: ["Holds","the","param-space","coordinates","(","X",")","and","target","values","(","Y",")","Allows","for","constant-time","appends","while","ensuring","no","duplicates","are","added","Example","--","--","--","-",">",">",">","def","target_func","(","p1",",","p2",")",":",">",">",">","return","p1","+","p2",">",">",">","pbounds","=","{","'p1","'",":","(","0",",","1",")",",","'p2","'",":","(","1",",","100",")","}",">",">",">","space","=","TargetSpace","(","target_func",",","pbounds",",","random_state=0",")",">",">",">","x","=","np.array","(","[","4",",","5","]",")",">",">",">","y","=","target_func","(","x",")",">",">",">","space.register","(","x",",","y",")",">",">",">","assert","self.max","(",")","[","'target","'","]","==","9",">",">",">","assert","self.max","(",")","[","'params","'","]","==","{","'p1","'",":","1.0",",","'p2","'",":","2.0","}"]
docstr: Returns a boolean array of the points that satisfy the constraint and boundary conditions
docstr_tok: ["Returns","a","boolean","array","of","the","points","that","satisfy","the","constraint","and","boundary","conditions"]
code: def mask(self):
      """Returns a boolean array of the points that satisfy the constraint and boundary conditions"""
      mask = np.ones_like(self.target, dtype=bool)
  
      # mask points that don't satisfy the constraint
      if self._constraint is not None:
          mask &= self._constraint.allowed(self._constraint_values)
  
      # mask points that are outside the bounds
      if self._bounds is not None:
          within_bounds = np.all(
              (self._bounds[:, 0] <= self._params)
              & (self._params <= self._bounds[:, 1]),
              axis=1,
          )
          mask &= within_bounds
  
      return mask
  
imports: import numpy
  from warnings import warn
  from .util import ensure_rng, NotUniqueError
  from .util import Colours
label_desc: Use image node_id 12 for calling the TargetSpace obj's underlying member method code with example usage: obj.mask() and returns: mask