class_docstr: A unit test to test ancillary utils in setting up a cartesian product GP. 
class_docstr_tok: ["A","unit","test","to","test","ancillary","utils","in","setting","up","a","cartesian","product","GP","."]
docstr: Tests creation of the function. 
docstr_tok: ["Tests","creation","of","the","function","."]
code: def test_function_loading_and_processing(self):
      """Tests creation of the function."""
      self.report(
          "Testing function evaluations before and after packing."
      )
      num_samples = 25
      for idx, (dcf, raw_func) in enumerate(self.synthetic_functions):
          (
              cp_dom,
              orderings,
          ) = cp_domain_utils.load_cp_domain_from_config_file(dcf)
          proc_func = cp_domain_utils.get_processed_func_from_raw_func_for_cp_domain(
              raw_func,
              cp_dom,
              orderings.index_ordering,
              orderings.dim_ordering,
          )
          # Draw samples
          proc_samples = cp_domain_utils.sample_from_cp_domain(
              cp_dom, num_samples
          )
          raw_samples = [
              cp_domain_utils.get_raw_point_from_processed_point(
                  x,
                  cp_dom,
                  orderings.index_ordering,
                  orderings.dim_ordering,
              )
              for x in proc_samples
          ]
          # Compute function values
          proc_vals = [proc_func(x) for x in proc_samples]
          raw_vals = [raw_func(x) for x in raw_samples]
          err = np.linalg.norm(np.array(proc_vals) - np.array(raw_vals))
          assert err < 1e-4 * np.linalg.norm(np.array(proc_vals))
          self.report(
              "[%d/%d] Testing function evaluations for %s, Error=%0.5f."
              % (idx + 1, len(self.synthetic_functions), dcf, err),
              "test_result",
          )
      self.report("", "")
  
imports: import os
  import numpy
  from .None import cp_domain_utils
  from ..test_data.park1_3.park1_3 import park1_3
  from ..test_data.park1_3.park1_3_mf import park1_3_mf
  from ..test_data.park2_4.park2_4 import park2_4
  from ..test_data.park2_4.park2_4_mf import park2_4_mf
  from ..utils.base_test_class import BaseTestClass, execute_tests
  from ..utils.general_utils import get_idxs_from_list_of_lists
label_desc: Use image node_id 7 for calling the CPDomainUtilsTestCase obj's underlying member method code with example usage: obj.test_function_loading_and_processing() without return types