parameters: (self,config)
return_statement: return closest, delta
docstring: looks for an existing or closest design 
              given a config
docstring_summary: looks for an existing or closest design 
              given a config
docstring_tokens: looks for an existing or closest design given a config
function: def closest_design(self,config):
          """ looks for an existing or closest design 
              given a config
          """        
                  
          designs = self.designs
          
          keys_check = ['DV_VALUE_NEW']
          
          if not designs: 
              return [] , inf
          
          diffs = []
          for this_design in designs:
              this_config = this_design.config
              distance = config.dist(this_config,keys_check)
              diffs.append(distance) 
                          
          #: for each design 
          
          # pick closest design
          i_min = np.argmin(diffs)
          delta  = diffs[i_min]
          closest = designs[i_min]
          
          return closest, delta
function_tokens: def closest_design ( self , config ) : designs = self . designs keys_check = [ 'DV_VALUE_NEW' ] if not designs : return [ ] , inf diffs = [ ] for this_design in designs : this_config = this_design . config distance = config . dist ( this_config , keys_check ) diffs . append ( distance ) #: for each design  # pick closest design i_min = np . argmin ( diffs ) delta = diffs [ i_min ] closest = designs [ i_min ] return closest , delta