data_basedb_initializerssynapse_activation_binning

synapse_activation_binning

Methods for fast binning of Synapse activation dataframes.

Example

>>> groupby  = ['EI']  # excitatory or inhibitory
>>> values = synapse_activation_postprocess_dask(
...    ddf = db['synapse_activation'],
...    groupby = groupby,
...    prefun = prefun,
...    applyfun = applyfun,
...    postfun = postfun)
>>> values = values.compute(scheduler=c.get)
>>> save_groupby(db, values, groupby)

Functions

prefun(df)

Augment a Synapse activation dataframe with additional columns.

postfun(s, maxtime)

Postprocess a column of the binned synapse activations.

applyfun(pdf, maxtime)

Bin the synapse activations using universal().

synapse_activation_postprocess_pandas(pdf, groupby, prefun, applyfun, postfun)

Calculates bins of synapse activation per trial from a pandas dataframe.

merge_results_together(dicts)

Aggregate many dictionaries with the same keys.

tree_reduction(delayeds, aggregate_fun, length)

Recursively aggregate the results of a list of delayed objects.

synapse_activation_postprocess_dask(ddf, **kwargs)

Calculates bins of synapse activation per trial from a dask dataframe.

save_groupby(db, result, groupby)

Save the result of synapse_activation_postprocess_dask to a database.

init(db, groupby, scheduler, prefun, applyfun, postfun, maxtime)

Main pipeline to bin synapse activations from a Synapse activation dataframe.