(D, calc_second_order, n_processors)
return tasks, n_processors
Create list with one entry (key, parameter 1, parameter 2) per sobol
    index (+conf.). This is used to supply parallel tasks to
    multiprocessing.Pool
Create list with one entry (key, parameter 1, parameter 2) per sobol
    index (+conf.). This is used to supply parallel tasks to
    multiprocessing.Pool
Create list with one entry ( key parameter 1 parameter 2 ) per sobol index ( + conf . ) . This is used to supply parallel tasks to multiprocessing . Pool
def create_task_list(D, calc_second_order, n_processors):
    """
    Create list with one entry (key, parameter 1, parameter 2) per sobol
    index (+conf.). This is used to supply parallel tasks to
    multiprocessing.Pool
    """
    tasks_first_order = [[d, j, None] for j in range(
        D) for d in ('S1', 'S1_conf', 'ST', 'ST_conf')]

    # Add second order (+conf.) to tasks
    tasks_second_order = []
    if calc_second_order:
        tasks_second_order = [[d, j, k] for j in range(D) for k in
                              range(j + 1, D) for d in ('S2', 'S2_conf')]

    if n_processors is None:
        n_processors = min(cpu_count(), len(
            tasks_first_order) + len(tasks_second_order))

    if not calc_second_order:
        tasks = np.array_split(tasks_first_order, n_processors)
    else:
        # merges both lists alternating its elements and splits the
        # resulting lists into n_processors sublists
        tasks = np.array_split([v for v in sum(
            zip_longest(tasks_first_order[::-1], tasks_second_order), ())
            if v is not None], n_processors)

    return tasks, n_processors
def create_task_list ( D , calc_second_order , n_processors ) : tasks_first_order = [ [ d , j , None ] for j in range ( D ) for d in ( 'S1' , 'S1_conf' , 'ST' , 'ST_conf' ) ] # Add second order (+conf.) to tasks tasks_second_order = [ ] if calc_second_order : tasks_second_order = [ [ d , j , k ] for j in range ( D ) for k in range ( j + 1 , D ) for d in ( 'S2' , 'S2_conf' ) ] if n_processors is None : n_processors = min ( cpu_count ( ) , len ( tasks_first_order ) + len ( tasks_second_order ) ) if not calc_second_order : tasks = np . array_split ( tasks_first_order , n_processors ) else : # merges both lists alternating its elements and splits the # resulting lists into n_processors sublists tasks = np . array_split ( [ v for v in sum ( zip_longest ( tasks_first_order [ : : - 1 ] , tasks_second_order ) , ( ) ) if v is not None ] , n_processors ) return tasks , n_processors