pyphi.parallel.sampling.compute_chunksize#

pyphi.parallel.sampling.compute_chunksize(items, *, target_seconds=1.0, fn=None, sample_size=4, sequential_threshold=1, explicit_chunksize=None)[source]#

Return (chunksize, items_iterator, sampled) for a workload.

The returned iterator yields all original items including the ones used for sampling. sampled holds one (position, result) pair per sampled item (positions index into the returned iterator’s order), so callers can reuse the results already computed during sampling. If explicit_chunksize is provided, sampling is skipped entirely and sampled is empty.

Parameters:
Return type:

tuple[int, Iterator[Any], list[tuple[int, Any]]]