def bond_run(perc_graph_result, seed, ps, convolution_factors_tasks):
microcanonical_statistics = percolate.hpc.bond_microcanonical_statistics(<EOL>seed=seed, **perc_graph_result<EOL>)<EOL>canonical_statistics = np.empty(<EOL>ps.size,<EOL>dtype=percolate.hpc.canonical_statistics_dtype(<EOL>spanning_cluster=SPANNING_CLUSTER,<EOL>)<EOL>)<EOL>for row, convolution_factors_task in zip(<EOL>np.nditer(canonical_statistics, op_flags=['<STR_LIT>']),<EOL>convolution_factors_tasks,<EOL>):<EOL><INDENT>assert not convolution_factors_task.is_loaded()<EOL>convolution_factors_task.load()<EOL>my_convolution_factors = convolution_factors_task.result<EOL>row[...] = percolate.hpc.bond_canonical_statistics(<EOL>microcanonical_statistics=microcanonical_statistics,<EOL>convolution_factors=my_convolution_factors,<EOL>spanning_cluster=SPANNING_CLUSTER,<EOL>)<EOL>convolution_factors_task.unload()<EOL><DEDENT>ret = percolate.hpc.bond_initialize_canonical_averages(<EOL>canonical_statistics=canonical_statistics,<EOL>spanning_cluster=SPANNING_CLUSTER,<EOL>)<EOL>return ret<EOL>
Perform a single run (realization) over all microstates and return the
canonical cluster statistics