def _accumulate(data_list, no_concat=()):
    """Concatenate a list of dicts `(name, array)`.

    You can specify some names which arrays should not be concatenated.
    This is necessary with lists of plots with different sizes.

    """
    acc = Accumulator()
    for data in data_list:
        for name, val in data.items():
            acc.add(name, val)
    out = {name: acc[name] for name in acc.names if name not in no_concat}

    # Some variables should not be concatenated but should be kept as lists.
    # This is when there can be several arrays of variable length (NumPy
    # doesn't support ragged arrays).
    out.update({name: acc.get(name) for name in no_concat})
    return out
def _accumulate ( data_list , no_concat = ( ) ) : acc = Accumulator ( ) for data in data_list : for name , val in data . items ( ) : acc . add ( name , val ) out = { name : acc [ name ] for name in acc . names if name not in no_concat } out . update ( { name : acc . get ( name ) for name in no_concat } ) return out
Concatenate a list of dicts `(name, array)`.

    You can specify some names which arrays should not be concatenated.
    This is necessary with lists of plots with different sizes.