data_basedb_initializerssynapse_activation_binningsynapse_activation_postprocess_dask

synapse_activation_postprocess_dask

data_base.db_initializers.synapse_activation_binning.synapse_activation_postprocess_dask(ddf, **kwargs)

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

Parameters:
  • ddf (dask.dataframe) – synapse activation dask dataframe

  • groupby (str) – species for which subgroups the bins should be calculated. Available values include: - celltype - presynaptic\_column - proximal (soma distance < 500 um) - EI (Lumping the EXC / INH celltypes together) - binned\_somadist: synapse counts for all 50 microns - any column in the specified dataframe.

  • db (DataBase) – if specified, the result will be computed immediately and saved in the database immediately.

  • get (dask scheduler) – only has an effect if ‘db’ kwarg is provided. In this case, it allows to specify a dask scheduler for the computation.

  • scheduler (dask scheduler) – Specify a dask scheduler for the computation (e.g. dask.distributed.Client.get())

  • prefun (callable) – A function to preprocess the synapse activation dataframe before binning. The function should take a pandas dataframe and return a pandas dataframe. Default: prefun()

  • applyfun (callable) – A function to bin the synapse activations. The function should take a pandas dataframe and return a numpy array. Default: applyfun()

  • postfun (callable) – A function to postprocess the binned synapse activations. The function should take a pandas series and return a numpy array. Default: postfun()

Returns:

If computed, this will return a dictionary containing numpy arrays, whose rows are sim trials, and columns are time bins. The dictionary keys are defined by groupby.

Return type:

dask.delayed

See also

synapse_activation_postprocess_pandas() for the non-delayed version of this method.