openmdao/core/total_jac.py
def _fix_pdc_lengths(idx_iter_dict):
    """
    Take any parallel_deriv_color entries and make sure their index arrays are same length.

    Parameters
    ----------
    idx_iter_dict : dict
        Dict of a name/color mapped to indexing information.
    """
    for imeta, _ in itervalues(idx_iter_dict):
        par_deriv_color = imeta['par_deriv_color']
        matmat = imeta['matmat']
        range_list = imeta['idx_list']
        if par_deriv_color:
            if not matmat:
                lens = np.array([end - start for start, end in range_list])
                maxlen = np.max(lens)
                diffs = lens - maxlen
            if not matmat and np.any(diffs):
                for i, diff in enumerate(diffs):
                    start, end = range_list[i]
                    if diff < 0:
                        range_list[i] = np.empty(maxlen, dtype=int)
                        range_list[i][:end - start] = np.arange(start, end, dtype=int)
                        range_list[i][end - start:] = range_list[i][end - start - 1]
                    else:
                        range_list[i] = np.arange(start, end, dtype=int)
            else:
                # just convert all (start, end) tuples to aranges
                for i, (start, end) in enumerate(range_list):
                    range_list[i] = np.arange(start, end, dtype=int)

    Take any parallel_deriv_color entries and make sure their index arrays are same length.

    Parameters
    ----------
    idx_iter_dict : dict
        Dict of a name/color mapped to indexing information.
    
Take any parallel_deriv_color entries and make sure their index arrays are same length.
Parameters

idx_iter_dict : dict
Dict of a name/color mapped to indexing information.
Take any parallel_deriv_color entries and make sure their index arrays are same length . Parameters idx_iter_dict : dict Dict of a name / color mapped to indexing information .
def _fix_pdc_lengths(idx_iter_dict):
    for imeta, _ in itervalues(idx_iter_dict):
        par_deriv_color = imeta['par_deriv_color']
        matmat = imeta['matmat']
        range_list = imeta['idx_list']
        if par_deriv_color:
            if not matmat:
                lens = np.array([end - start for start, end in range_list])
                maxlen = np.max(lens)
                diffs = lens - maxlen
            if not matmat and np.any(diffs):
                for i, diff in enumerate(diffs):
                    start, end = range_list[i]
                    if diff < 0:
                        range_list[i] = np.empty(maxlen, dtype=int)
                        range_list[i][:end - start] = np.arange(start, end, dtype=int)
                        range_list[i][end - start:] = range_list[i][end - start - 1]
                    else:
                        range_list[i] = np.arange(start, end, dtype=int)
            else:
                for i, (start, end) in enumerate(range_list):
                    range_list[i] = np.arange(start, end, dtype=int)
def _fix_pdc_lengths ( idx_iter_dict ) : for imeta , _ in itervalues ( idx_iter_dict ) : par_deriv_color = imeta [ 'par_deriv_color' ] matmat = imeta [ 'matmat' ] range_list = imeta [ 'idx_list' ] if par_deriv_color : if not matmat : lens = np . array ( [ end - start for start , end in range_list ] ) maxlen = np . max ( lens ) diffs = lens - maxlen if not matmat and np . any ( diffs ) : for i , diff in enumerate ( diffs ) : start , end = range_list [ i ] if diff < 0 : range_list [ i ] = np . empty ( maxlen , dtype = int ) range_list [ i ] [ : end - start ] = np . arange ( start , end , dtype = int ) range_list [ i ] [ end - start : ] = range_list [ i ] [ end - start - 1 ] else : range_list [ i ] = np . arange ( start , end , dtype = int ) else : for i , ( start , end ) in enumerate ( range_list ) : range_list [ i ] = np . arange ( start , end , dtype = int )
Take any parallel_deriv_color entries and make sure their index arrays are same length.
Take any parallel_deriv_color entries and make sure their index arrays are same length .
"""
    Take any parallel_deriv_color entries and make sure their index arrays are same length.

    Parameters
    ----------
    idx_iter_dict : dict
        Dict of a name/color mapped to indexing information.
    """ # just convert all (start, end) tuples to aranges
idx_iter_dict