original_docstring: Adds interconnect name to bus, branch, plant and dcline data frames of
          grid instance.
  
      :param powersimdata.input.grid.Grid grid: grid instance.
      
docstring: Adds interconnect name to bus, branch, plant and dcline data frames of
  grid instance.
docstring_tokens: Adds interconnect name to bus branch plant and dcline data frames of grid instance .
code: def add_interconnect_to_grid_data_frames(grid):
      """Adds interconnect name to bus, branch, plant and dcline data frames of
          grid instance.
  
      :param powersimdata.input.grid.Grid grid: grid instance.
      """
      bus2interconnect = grid.bus2sub.interconnect.to_dict()
  
      def get_interconnect(idx):
          return [bus2interconnect[i] for i in idx]
  
      extra_col_bus = {"interconnect": get_interconnect(grid.bus.index)}
      add_column_to_data_frame(grid.bus, extra_col_bus)
  
      extra_col_branch = {"interconnect": get_interconnect(grid.branch.from_bus_id)}
      add_column_to_data_frame(grid.branch, extra_col_branch)
  
      extra_col_plant = {"interconnect": get_interconnect(grid.plant.bus_id)}
      add_column_to_data_frame(grid.plant, extra_col_plant)
  
      extra_col_gencost = {"interconnect": get_interconnect(grid.plant.bus_id)}
      add_column_to_data_frame(grid.gencost["before"], extra_col_gencost)
      add_column_to_data_frame(grid.gencost["after"], extra_col_gencost)
  
      extra_col_dcline = {
          "from_interconnect": get_interconnect(grid.dcline.from_bus_id),
          "to_interconnect": get_interconnect(grid.dcline.to_bus_id),
      }
      add_column_to_data_frame(grid.dcline, extra_col_dcline)
code_tokens: def add_interconnect_to_grid_data_frames ( grid ) : bus2interconnect = grid . bus2sub . interconnect . to_dict ( ) def get_interconnect ( idx ) : return [ bus2interconnect [ i ] for i in idx ] extra_col_bus = { "interconnect" : get_interconnect ( grid . bus . index ) } add_column_to_data_frame ( grid . bus , extra_col_bus ) extra_col_branch = { "interconnect" : get_interconnect ( grid . branch . from_bus_id ) } add_column_to_data_frame ( grid . branch , extra_col_branch ) extra_col_plant = { "interconnect" : get_interconnect ( grid . plant . bus_id ) } add_column_to_data_frame ( grid . plant , extra_col_plant ) extra_col_gencost = { "interconnect" : get_interconnect ( grid . plant . bus_id ) } add_column_to_data_frame ( grid . gencost [ "before" ] , extra_col_gencost ) add_column_to_data_frame ( grid . gencost [ "after" ] , extra_col_gencost ) extra_col_dcline = { "from_interconnect" : get_interconnect ( grid . dcline . from_bus_id ) , "to_interconnect" : get_interconnect ( grid . dcline . to_bus_id ) , } add_column_to_data_frame ( grid . dcline , extra_col_dcline )
short_docstring: Adds interconnect name to bus, branch, plant and dcline data frames of
  grid instance.
short_docstring_tokens: Adds interconnect name to bus branch plant and dcline data frames of grid instance .
comment: """Adds interconnect name to bus, branch, plant and dcline data frames of
          grid instance.
  
      :param powersimdata.input.grid.Grid grid: grid instance.
      """