teehr.metrics.bootstrap_funcs.create_shared_bootstrap_func#

create_shared_bootstrap_func(metrics: List[MetricsBasemodel]) → Callable[source]#

Create a single bootstrap UDF that evaluates multiple metrics per draw.

All metrics in metrics must share the same bootstrap configuration (same class, reps, seed, block_size, quantiles, guards, and input fields).

The caller must pass the bootstrap’s sort_by field(s) as the last positional args of the UDF, which is what format.py does. How many there are is read off the same sort_by it read to build the arg list, rather than being handed over separately – one fact, one place.

Parameters:

metrics (List[MetricsBasemodel]) – Metrics sharing the same bootstrap config.

Returns:

Callable – UDF returning dict with per-metric quantiles or raw bootstrap arrays.