def reinforce_branches_voltage(grid, crit_branches, grid_level='MV'):
    #TODO: finish docstring
    """ Reinforce MV or LV grid by installing a new branch/line type

    Parameters
    ----------
    grid : GridDing0
        Grid identifier.
    crit_branches : :any:`list` of :obj:`int`
        List of critical branches. #TODO: check if a list or a dictionary
    grid_level : str
        Specifying either 'MV' for medium-voltage grid or 'LV' for
        low-voltage grid level.
        
    Notes
    -----
    The branch type to be installed is determined per branch - the next larger cable available is used.
    According to Ackermann only cables are installed.
        
    See Also
    --------
    ding0.flexopt.check_tech_constraints.check_load :
    ding0.flexopt.reinforce_measures.reinforce_branches_voltage :
    """

    # load cable data, file_names and parameter
    branch_parameters = grid.network.static_data['{gridlevel}_cables'.format(
        gridlevel=grid_level)]
    branch_parameters = branch_parameters[branch_parameters['U_n'] == grid.v_level].sort_values('I_max_th')

    branch_ctr = 0

    for branch in crit_branches:
        try:
            type = branch_parameters.loc[
                branch_parameters.loc[
                       branch_parameters['I_max_th'] > branch.type['I_max_th']
                ].loc[
                    :, 'I_max_th'
                ].idxmin(), :
            ]
            branch.type = type
            branch_ctr += 1
        except:
            logger.warning('Branch {} could not be reinforced (voltage '
                           'issues) as there is no appropriate cable type '
                           'available. Original type is retained.'.format(
                branch))
            pass


    if branch_ctr:
        logger.info('==> {} branches were reinforced.'.format(str(branch_ctr)))
Reinforce MV or LV grid by installing a new branch/line type

    Parameters
    ----------
    grid : GridDing0
        Grid identifier.
    crit_branches : :any:`list` of :obj:`int`
        List of critical branches. #TODO: check if a list or a dictionary
    grid_level : str
        Specifying either 'MV' for medium-voltage grid or 'LV' for
        low-voltage grid level.
        
    Notes
    -----
    The branch type to be installed is determined per branch - the next larger cable available is used.
    According to Ackermann only cables are installed.
        
    See Also
    --------
    ding0.flexopt.check_tech_constraints.check_load :
    ding0.flexopt.reinforce_measures.reinforce_branches_voltage :