code: def test_infinite_distance_last_evaluations(self):
      # Optimization with a single data point will have the distance between last evaluations go to infinity
      # This will not be interpreted as a converged state and continue as expected
      domain = [
          {"name": "x", "type": "continuous", "domain": (-10, 10)}
      ]
  
      # one initial data point found randomly
      bo = GPyOpt.methods.BayesianOptimization(
          lambda x: x * x,
          domain=domain,
          X=None,
          Y=None,
          initial_design_numdata=1,
          initial_design_type="random",
      )
      bo.run_optimization(max_iter=3)
      assert len(bo.X) == 4
      assert len(bo.Y) == 4
  
      # one initial data point given by the user
      bo2 = GPyOpt.methods.BayesianOptimization(
          lambda x: x * x,
          domain=domain,
          X=np.array([[1]]),
          Y=np.array([[1]]),
          initial_design_numdata=0,
      )
      bo2.run_optimization(max_iter=2)
      assert len(bo2.X) == 3
      assert len(bo2.Y) == 3
  
file_path: GPyOpt/GPyOpt/testing/methods_tests/test_bayesian_optimization.py
imports: import unittest
  import numpy
  import GPyOpt
  from GPyOpt.methods import BayesianOptimization
label_desc: Use image node_id 4 for calling the TestBayesianOptimization obj's underlying member method code with example usage: obj.test_infinite_distance_last_evaluations() without return types