class_docstr: Class to test the mapping of the objective function through the context
class_docstr_tok: ["Class","to","test","the","mapping","of","the","objective","function","through","the","context"]
docstr: Test for the mapping and the gradient through the context variables
docstr_tok: ["Test","for","the","mapping","and","the","gradient","through","the","context","variables"]
code: def test_objective_and_mapping_objective(self):
      """
      Test for the mapping and the gradient through the context variables
      """
      f_nc_x = np.array([-0.10986074])
      df_nc_x = np.array([[0, 0, 0]])
      (
          tested_mapping,
          tested_gradient,
      ) = self.problem_with_context.f_df_nc(self.x)
      print(tested_mapping)
      print(tested_gradient)
  
      self.assertTrue(np.isclose(tested_mapping, f_nc_x).all())
      self.assertTrue(np.isclose(tested_gradient, df_nc_x).all())
  
file_path: GPyOpt/GPyOpt/testing/optimization_tests/test_problem_with_context.py
imports: import numpy
  import unittest
  from GPyOpt.core.task.space import Design_space
  from GPyOpt.optimization.acquisition_optimizer import ContextManager
  from GPyOpt.optimization.optimizer import OptimizationWithContext
  from GPyOpt.methods import BayesianOptimization
  from GPyOpt.objective_examples.experimentsNd import alpine1
label_desc: Use image node_id 4 for calling the TestOptimizationWithContext obj's underlying member method code with example usage: obj.test_objective_and_mapping_objective() without return types