class_docstr: A Space class for agents, variables and methods
  related to the search space.
class_docstr_tok: ["A","Space","class","for","agents",",","variables","and","methods","related","to","the","search","space","."]
code: def ub(self, ub: np.ndarray) -> None:
      if not isinstance(ub, np.ndarray):
          raise e.TypeError("`ub` should be a numpy array")
      if not ub.shape:
          ub = np.expand_dims(ub, -1)
      if not ub.shape or ub.shape[0] != self.n_variables:
          raise e.SizeError(
              "`ub` should be the same size as `n_variables`"
          )
  
      self._ub = ub
  
imports: from typing import List, Optional, Tuple, Union
  import numpy
  import opytimizer.utils.exception
  from opytimizer.core import Agent
  from opytimizer.utils import logging
label_desc: Use image node_id 11 for calling the Space obj's underlying member method code with example usage: obj.ub(ub) without return types