def get_grid_capacity(grid, plus, minus):
    """Read the grid capacity from a given region pair from the renpass db."""
    tmp_grid = grid.query(
        "plus_region_id == {:0d} & ".format(plus)
        + "minus_region_id == {:1d} & ".format(minus)
        + "scenario_name == 'status_quo_2012_distance'"
    )

    if len(tmp_grid) > 0:
        capacity = tmp_grid.capacity_calc.sum()
        distance = tmp_grid.distance.iloc[0]
    else:
        capacity = 0
        distance = 0
    return capacity, distance