Skip to content

feat(explorer): use uncertainties for analysis propagation#269

Open
Rajesh270712 wants to merge 1 commit into
Deltakit:mainfrom
Rajesh270712:bountyops/UH-DELTAKIT-215-uncertainties-analysis-helpers
Open

feat(explorer): use uncertainties for analysis propagation#269
Rajesh270712 wants to merge 1 commit into
Deltakit:mainfrom
Rajesh270712:bountyops/UH-DELTAKIT-215-uncertainties-analysis-helpers

Conversation

@Rajesh270712
Copy link
Copy Markdown

Summary

  • Adds uncertainties~=3.2 to deltakit-explorer.
  • Uses ufloat, unumpy, and correlated_values for LEPPR, log-fidelity, and lambda uncertainty propagation.
  • Keeps public return values as plain floats/arrays and adds focused parity tests.

Links

Problem

Issue #215 asks for the analysis helpers to use uncertainties instead of maintaining standard-deviation propagation formulas manually. The existing LEPPR/log-fidelity/lambda paths computed propagated errors by hand, which made the formulas harder to audit and extend.

Fix

This PR adds uncertainties to the explorer package and delegates the affected propagation steps to uncertainties helpers. The external API shape is unchanged: callers still receive floats or NumPy arrays rather than uncertainties objects.

Validation

  • uv run --group test pytest deltakit-explorer/tests/analysis/test_leppr.py deltakit-explorer/tests/analysis/test_lambda.py deltakit-explorer/tests/analysis/budget/test_post_processing.py -q -> 6063 passed in 11.25s
  • uv run --group lint ruff check deltakit-explorer/src/deltakit_explorer/analysis/_leppr.py deltakit-explorer/src/deltakit_explorer/analysis/_lambda.py deltakit-explorer/tests/analysis/test_leppr.py deltakit-explorer/tests/analysis/test_lambda.py -> All checks passed!
  • uv run --group lint mypy --config-file deltakit-explorer/pyproject.toml deltakit-explorer/src/deltakit_explorer/analysis/_leppr.py deltakit-explorer/src/deltakit_explorer/analysis/_lambda.py -> Success: no issues found in 2 source files
  • uv run --group lint deptry deltakit-explorer/src --config deltakit-explorer/pyproject.toml -> Success! No dependency issues found.
  • uv run python -c "import uncertainties; import deltakit_explorer.analysis._leppr; import deltakit_explorer.analysis._lambda; print(uncertainties.__version__)" -> 3.2.3
  • git diff --check origin/main...HEAD -> passed with no output

Risk Notes

  • I did not run the full repository test suite; validation covered the changed analysis tests, an adjacent budget post-processing guard, changed-file lint, changed-source typing, deptry, import check, and diff check.
  • uncertainties does not ship type stubs, so the mypy configuration includes a narrow missing-import override for that dependency.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jun 3, 2026

CLA assistant check
All committers have signed the CLA.

@Rajesh270712 Rajesh270712 force-pushed the bountyops/UH-DELTAKIT-215-uncertainties-analysis-helpers branch from b778c15 to 5e72619 Compare June 4, 2026 05:43
@nelimee nelimee added the UnitaryHACK26 Issues that are part of the Unitary Hack 2026. label Jun 4, 2026
@Rajesh270712 Rajesh270712 force-pushed the bountyops/UH-DELTAKIT-215-uncertainties-analysis-helpers branch from 9575fab to deda98d Compare June 4, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deltakit-explorer UnitaryHACK26 Issues that are part of the Unitary Hack 2026.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants