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 packing and unpacking of points in both fidelity and domain. 
docstr_tok: ["Tests","packing","and","unpacking","of","points","in","both","fidelity","and","domain","."]
code: def test_packing_and_unpacking_with_config(self):
      """Tests packing and unpacking of points in both fidelity and domain."""
      self.report(
          "Testing packing and unpacking from a configuration file."
      )
      test_data = (
          self.synthetic_functions[:4]
          + self.domain_fidel_synthetic_functions
      )
      num_samples = 8
      for idx, (dcf, _) in enumerate(test_data):
          config = cp_domain_utils.load_config_file(dcf)
          has_fidel = hasattr(config, "fidel_space")
          self.report(
              "[%d/%d] Testing packing/unpacking from %s, has fidel = %d."
              % (idx + 1, len(test_data), dcf, has_fidel)
          )
          if has_fidel:
              self.report(
                  "fidel_space: %s" % (config.fidel_space),
                  "test_result",
              )
          self.report("domain: %s" % (config.domain), "test_result")
          proc_samples_1 = cp_domain_utils.sample_from_config_space(
              config, num_samples
          )
          raw_samples_1 = [
              cp_domain_utils.get_raw_from_processed_via_config(
                  x, config
              )
              for x in proc_samples_1
          ]
          proc_samples_2 = [
              cp_domain_utils.get_processed_from_raw_via_config(
                  x, config
              )
              for x in raw_samples_1
          ]
          raw_samples_2 = [
              cp_domain_utils.get_raw_from_processed_via_config(
                  x, config
              )
              for x in proc_samples_2
          ]
          if has_fidel:
              fidel_proc_1 = get_idxs_from_list_of_lists(
                  proc_samples_1, 0
              )
              fidel_proc_2 = get_idxs_from_list_of_lists(
                  proc_samples_2, 0
              )
              fidel_raw_1 = get_idxs_from_list_of_lists(
                  raw_samples_1, 0
              )
              fidel_raw_2 = get_idxs_from_list_of_lists(
                  raw_samples_2, 0
              )
              domain_proc_1 = get_idxs_from_list_of_lists(
                  proc_samples_1, 1
              )
              domain_proc_2 = get_idxs_from_list_of_lists(
                  proc_samples_2, 1
              )
              domain_raw_1 = get_idxs_from_list_of_lists(
                  raw_samples_1, 1
              )
              domain_raw_2 = get_idxs_from_list_of_lists(
                  raw_samples_2, 1
              )
              # Test if equal
              self._test_if_two_lists_of_objects_are_equal(
                  fidel_proc_1, fidel_proc_2
              )
              self._test_if_two_lists_of_objects_are_equal(
                  fidel_raw_1, fidel_raw_2
              )
              self._test_if_two_lists_of_objects_are_equal(
                  domain_proc_1, domain_proc_2
              )
              self._test_if_two_lists_of_objects_are_equal(
                  domain_raw_1, domain_raw_2
              )
          else:
              self._test_if_two_lists_of_objects_are_equal(
                  proc_samples_1, proc_samples_2
              )
              self._test_if_two_lists_of_objects_are_equal(
                  raw_samples_1, raw_samples_2
              )
      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 9 for calling the CPDomainUtilsTestCase obj's underlying member method code with example usage: obj.test_packing_and_unpacking_with_config() without return types