code: def calc_geo_dist_vincenty(network, node_source, node_target):
      
  
      branch_detour_factor = network.config['grid_connection'][
          'branch_detour_factor']
  
      # notice: vincenty takes (lat,lon)
      branch_length = branch_detour_factor * vincenty((node_source.geom.y, node_source.geom.x),
                                                      (node_target.geom.y, node_target.geom.x)).m
  
      # ========= BUG: LINE LENGTH=0 WHEN CONNECTING GENERATORS ===========
      # When importing generators, the geom_new field is used as position. If it is empty, EnergyMap's geom
      # is used and so there are a couple of generators at the same position => length of interconnecting
      # line is 0. See issue #76
      if branch_length == 0:
          branch_length = 1
          logger.debug('Geo distance is zero, check objects\' positions. '
                       'Distance is set to 1m')
      # ===================================================================
  
      return branch_length
docs: Calculates the geodesic distance between node_source and node_target
      incorporating the detour factor in config.
  
      Parameters
      ----------
      network : :class:`~.grid.network.Network`
          The eDisGo container object
      node_source : :class:`~.grid.components.Component`
          Node to connect (e.g. :class:`~.grid.components.Generator`)
      node_target : :class:`~.grid.components.Component`
          Target node (e.g. :class:`~.grid.components.BranchTee`)
  
      Returns
      -------
      :obj:`float`
          Distance in m