Skip to content

feat: composable Metric/Aggregation primitives for KPI#119

Merged
rororowyourboat merged 2 commits intodevfrom
feat/psuu-metric-kpi
Mar 5, 2026
Merged

feat: composable Metric/Aggregation primitives for KPI#119
rororowyourboat merged 2 commits intodevfrom
feat/psuu-metric-kpi

Conversation

@rororowyourboat
Copy link
Collaborator

Summary

  • Introduces Metric (per-run scalar extractor) and Aggregation (cross-run reducer) as composable building blocks for KPIs, aligning with the simulation/optimization glossary hierarchy
  • KPI now accepts either legacy fn or composable metric + aggregation pair (backwards compatible)
  • Built-in metric factories: final_value, trajectory_mean, max_value, min_value
  • Built-in aggregations: mean_agg, std_agg, percentile_agg, probability_above, probability_below
  • EvaluationResult now includes per-run distributions for metric-based KPIs
  • 31 new tests covering metrics, aggregations, composable KPIs, evaluator distributions, and sweep integration

Closes #118

Test plan

  • All 82 gds-psuu tests pass (1 skipped — optional optuna dep)
  • Ruff lint + format clean
  • Legacy KPI(fn=...) usage unchanged
  • New KPI(metric=..., aggregation=...) composable API tested
  • per_run() and distributions populated correctly
  • Sweep integration with composable KPIs verified

🤖 Generated with Claude Code

Introduce composable Metric (per-run scalar) and Aggregation (across-run
reducer) types that compose into KPIs, aligning with the simulation glossary
hierarchy. KPI now accepts either legacy fn or metric+aggregation pair.

Built-in metrics: final_value, trajectory_mean, max_value, min_value
Built-in aggregations: mean, std, percentile, probability_above/below

Evaluator populates per-run distributions for metric-based KPIs.

Closes #118
Overview, getting started guide, concept hierarchy (Metric/Aggregation/KPI),
parameter spaces reference, optimizer guide, and API reference pages.
Adds psuu section to mkdocs nav and landing page package table.
@rororowyourboat rororowyourboat merged commit e6e8490 into dev Mar 5, 2026
@rororowyourboat rororowyourboat deleted the feat/psuu-metric-kpi branch March 5, 2026 09:52
@rororowyourboat rororowyourboat mentioned this pull request Mar 5, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(gds-psuu): separate Metric from KPI with composable aggregation

1 participant