MCPcopy Create free account
hub / github.com/Flagsmith/flagsmith / build_results_summary

Function build_results_summary

api/experimentation/services.py:286–312  ·  view source on GitHub ↗
(
    aggregates: ResultsAggregates,
    *,
    expected_shares: dict[str, float],
)

Source from the content-addressed store, hash-verified

284
285
286def build_results_summary(
287 aggregates: ResultsAggregates,
288 *,
289 expected_shares: dict[str, float],
290) -> ResultsSummary:
291 exposure_counts = aggregates.exposure_counts
292 total = sum(exposure_counts.values())
293 if expected_shares and total >= SRM_MIN_TOTAL_IDENTITIES:
294 srm = srm_p_value(
295 [exposure_counts.get(variant, 0) for variant in expected_shares],
296 list(expected_shares.values()),
297 )
298 else:
299 srm = None
300 return ResultsSummary(
301 srm_p_value=srm,
302 metrics=[
303 MetricResult(
304 metric_id=spec.metric_id,
305 variants=aggregates.metric_stats.get(spec.metric_id, {}),
306 inference=_metric_inference(
307 spec, aggregates.metric_stats.get(spec.metric_id, {})
308 ),
309 )
310 for spec in aggregates.specs
311 ],
312 )
313
314
315def compute_results_summary(

Callers 1

compute_results_summaryFunction · 0.85

Calls 5

srm_p_valueFunction · 0.90
ResultsSummaryClass · 0.90
MetricResultClass · 0.90
_metric_inferenceFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…