data_basedb_initializerssynapse_activation_binningtree_reduction

tree_reduction

data_base.db_initializers.synapse_activation_binning.tree_reduction(delayeds, aggregate_fun, length=7)

Recursively aggregate the results of a list of delayed objects.

This is used in synapse_activation_postprocess_dask() and synapse_activation_postprocess_pandas() to aggregate the resulting synapse binning (which is in dictionary format) to a single dictionary.

Parameters:
  • delayeds (array) – list of delayed objects

  • aggregate_fun (delayed) – Function to aggregate the results with (e.g. merge_results_together())

  • length (int) – chunk size for aggregation

Note

Once the delayed objects are evaluated, aggregate_fun is applied to the results of delayeds, and thus aggregate_fun should be able to handle the results of delayeds.

Returns:

The aggregated result.

Return type:

dask.delayed