Repository navigation
pynumerics: exact factorial oracles and timing checks as benchmarks - #151
Merged
Merged
Conversation
…er values rounded to double instead of SciPy's gamma-based floating factorial, whose accuracy varies by SciPy version and platform
…ult; their correctness checks stay in the default run
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
The v2.3.0 PyPI publish run failed on its Windows, Python 3.11 test job in
test_factorials_and_binomial_coefficients_match_scipy. That environment resolved SciPy 1.17.1, whose floatingscipy.special.factorialis a gamma approximation that is off by up to 8e-14 relative (34!: SciPy 2.9523279903960253e38, exact 2.9523279903960416e38). pynumerics was the accurate side.float(math.factorial(k))andfloat(math.comb(n, k)), the exact integers rounded to double, so they no longer depend on the SciPy version or platform. Tolerances are unchanged.@pytest.mark.benchmark, deselected by default (pytest -m benchmarkruns them). Where a test also checked results (bits equal to the scalar path, the same replicates, agreement with SciPy or scikit-learn), those checks stay in an unmarked functional test.Validation: ruff clean; Linux Docker wheel build and default pytest 5764 passed, 6 skipped, 27 deselected (benchmarks), 0 failed.
After merge
gh workflow run PythonPublish.yml -R USACE-RMC/Numerics --ref main -f release_tag=v2.3.0 -f publish_to_pypi=true, then approve thepypienvironment.🤖 Generated with Claude Code