feat: add OpenEntropy source and ECDF amplifier from PR #4#7
Merged
alchemystack merged 2 commits intomainfrom Mar 27, 2026
Merged
feat: add OpenEntropy source and ECDF amplifier from PR #4#7alchemystack merged 2 commits intomainfrom
alchemystack merged 2 commits intomainfrom
Conversation
Integrate OpenEntropy hardware entropy source and ECDF signal amplifier from ereid7's PR #4, with fixes for CI failures: - Move openentropy to optional dependency (was breaking Python 3.10/3.11/3.13) - Fix ruff formatting on openentropy.py and test_openentropy.py - Remove bandit-flagged assert in ecdf.py (invariant enforced by _calibrated) - Add ECDF calibration wiring in processor.py - Optimize _to_numpy with is_cpu check to avoid unnecessary .cpu() calls - Add oe_* config fields, entry point, mypy override, and tests 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Narrow _sorted_means with a local variable + None check instead of type: ignore comments, satisfying mypy --strict.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
openentropyfrom hard runtime dependency to optional extra (pip install qr-sampler[openentropy]), fixing install failures on Python 3.10/3.11/3.13 where no pre-built wheel existsassertinecdf.pythat triggered bandit B101, replacing with a type-narrowing comment (invariant already enforced by_calibratedguard)ruff formatto new files to pass lint checksChanges
src/qr_sampler/amplification/ecdf.py— ECDF-based signal amplifier (non-parametric, calibration-based)src/qr_sampler/entropy/openentropy.py— OpenEntropy hardware entropy source with graceful degradationtests/test_amplification/test_ecdf.py— ECDF amplifier tests including KS-test uniformitytests/test_entropy/test_openentropy.py— OpenEntropy tests (fully mocked, no install needed)deployments/openentropy/— Deployment profile with.env.exampleand READMEpyproject.toml— optional[openentropy]extra, entry point, mypy overrideconfig.py—ecdf_calibration_samples,oe_*config fieldsprocessor.py— ECDF calibration wiring viahasattr(amplifier, "calibrate")README.md,tests/test_config.py— docs and config test coverageCI fixes applied (vs original PR #4)
openentropymoved to optional dep — tests no longer fail building Rust on 3.10/3.11/3.13ruff formatapplied — lint check passesassertremoved inecdf.py— bandit security scan passesTest plan
openentropyinstall required)ruff checkandruff format --checkpassbandit -r src/ -qpasses cleanmypy --strict src/passesCloses #4