certsf 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. certsf-0.1.0/.gitattributes +1 -0
  2. certsf-0.1.0/.github/workflows/publish-pypi.yml +75 -0
  3. certsf-0.1.0/.github/workflows/publish-testpypi.yml +72 -0
  4. certsf-0.1.0/.github/workflows/pypi-smoke.yml +117 -0
  5. certsf-0.1.0/.github/workflows/release-checks.yml +47 -0
  6. certsf-0.1.0/.github/workflows/tests.yml +74 -0
  7. certsf-0.1.0/.gitignore +20 -0
  8. certsf-0.1.0/CHANGELOG.md +43 -0
  9. certsf-0.1.0/CITATION.cff +10 -0
  10. certsf-0.1.0/LICENSE +21 -0
  11. certsf-0.1.0/PKG-INFO +317 -0
  12. certsf-0.1.0/README.md +280 -0
  13. certsf-0.1.0/benchmarks/_common.py +36 -0
  14. certsf-0.1.0/benchmarks/bench_airy.py +17 -0
  15. certsf-0.1.0/benchmarks/bench_bessel.py +17 -0
  16. certsf-0.1.0/benchmarks/bench_gamma.py +17 -0
  17. certsf-0.1.0/benchmarks/bench_pcf.py +18 -0
  18. certsf-0.1.0/docs/audit/airy.md +42 -0
  19. certsf-0.1.0/docs/audit/bessel.md +45 -0
  20. certsf-0.1.0/docs/audit/gamma.md +46 -0
  21. certsf-0.1.0/docs/audit/parabolic_cylinder.md +57 -0
  22. certsf-0.1.0/docs/certification.md +195 -0
  23. certsf-0.1.0/docs/certification_audit.md +83 -0
  24. certsf-0.1.0/docs/certified_scope_0_1_0.md +65 -0
  25. certsf-0.1.0/docs/formula_audit.md +439 -0
  26. certsf-0.1.0/docs/post_release_verification.md +187 -0
  27. certsf-0.1.0/docs/release-0.1.0-alpha.2.md +61 -0
  28. certsf-0.1.0/docs/release-0.1.0-alpha.3.md +64 -0
  29. certsf-0.1.0/docs/release-0.1.0.md +114 -0
  30. certsf-0.1.0/docs/release_checklist.md +146 -0
  31. certsf-0.1.0/docs/release_claims.md +54 -0
  32. certsf-0.1.0/examples/airy_components.py +18 -0
  33. certsf-0.1.0/examples/basic_usage.py +24 -0
  34. certsf-0.1.0/examples/bessel_complex.py +21 -0
  35. certsf-0.1.0/examples/certified_vs_high_precision.py +75 -0
  36. certsf-0.1.0/examples/gamma_certified.py +18 -0
  37. certsf-0.1.0/examples/mcp_payload.py +18 -0
  38. certsf-0.1.0/examples/pcf_experimental.py +20 -0
  39. certsf-0.1.0/pyproject.toml +78 -0
  40. certsf-0.1.0/scripts/check_release_version.py +71 -0
  41. certsf-0.1.0/src/certsf/__init__.py +28 -0
  42. certsf-0.1.0/src/certsf/backends/__init__.py +1 -0
  43. certsf-0.1.0/src/certsf/backends/_common.py +83 -0
  44. certsf-0.1.0/src/certsf/backends/arb_backend.py +652 -0
  45. certsf-0.1.0/src/certsf/backends/mpmath_backend.py +233 -0
  46. certsf-0.1.0/src/certsf/backends/scipy_backend.py +204 -0
  47. certsf-0.1.0/src/certsf/dispatcher.py +465 -0
  48. certsf-0.1.0/src/certsf/functions/__init__.py +26 -0
  49. certsf-0.1.0/src/certsf/functions/airy.py +25 -0
  50. certsf-0.1.0/src/certsf/functions/bessel.py +21 -0
  51. certsf-0.1.0/src/certsf/functions/gamma.py +17 -0
  52. certsf-0.1.0/src/certsf/functions/parabolic_cylinder.py +25 -0
  53. certsf-0.1.0/src/certsf/mcp_server.py +105 -0
  54. certsf-0.1.0/src/certsf/result.py +134 -0
  55. certsf-0.1.0/tests/fixtures/external_reference/airy_reference.json +54 -0
  56. certsf-0.1.0/tests/fixtures/external_reference/bessel_reference.json +34 -0
  57. certsf-0.1.0/tests/fixtures/external_reference/gamma_reference.json +34 -0
  58. certsf-0.1.0/tests/fixtures/external_reference/parabolic_cylinder_reference.json +144 -0
  59. certsf-0.1.0/tests/test_airy.py +123 -0
  60. certsf-0.1.0/tests/test_bessel.py +172 -0
  61. certsf-0.1.0/tests/test_branch_singularity.py +51 -0
  62. certsf-0.1.0/tests/test_certification_audit.py +129 -0
  63. certsf-0.1.0/tests/test_certification_contract.py +92 -0
  64. certsf-0.1.0/tests/test_certified_identities.py +353 -0
  65. certsf-0.1.0/tests/test_dispatcher.py +65 -0
  66. certsf-0.1.0/tests/test_external_reference_fixtures.py +96 -0
  67. certsf-0.1.0/tests/test_gamma.py +124 -0
  68. certsf-0.1.0/tests/test_identity_residuals.py +300 -0
  69. certsf-0.1.0/tests/test_mcp_schema.py +72 -0
  70. certsf-0.1.0/tests/test_parabolic_cylinder_formula_audit.py +296 -0
  71. certsf-0.1.0/tests/test_pbdv.py +167 -0
  72. certsf-0.1.0/tests/test_public_contract.py +174 -0
  73. certsf-0.1.0/tests/test_release_artifacts.py +36 -0
  74. certsf-0.1.0/tests/test_release_claims.py +150 -0
  75. certsf-0.1.0/tests/test_release_scope.py +86 -0
  76. certsf-0.1.0/tests/test_release_version_check.py +54 -0
  77. certsf-0.1.0/tests/test_result.py +87 -0
  78. certsf-0.1.0/tests/test_v01x_audit_issues.py +331 -0
@@ -0,0 +1 @@
1
+ * text=auto eol=lf
@@ -0,0 +1,75 @@
1
+ name: publish-pypi
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ ref:
7
+ description: "Git ref or tag to publish"
8
+ required: true
9
+ default: "v0.1.0"
10
+
11
+ release:
12
+ types: [published]
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ jobs:
18
+ build:
19
+ name: Build distribution
20
+ runs-on: ubuntu-latest
21
+
22
+ steps:
23
+ - uses: actions/checkout@v6
24
+ with:
25
+ ref: ${{ github.event.release.tag_name || inputs.ref || github.ref }}
26
+ persist-credentials: false
27
+
28
+ - uses: actions/setup-python@v6
29
+ with:
30
+ python-version: "3.12"
31
+
32
+ - name: Check release tag matches package version
33
+ env:
34
+ RELEASE_REF: ${{ github.event.release.tag_name || inputs.ref || github.ref_name }}
35
+ run: python scripts/check_release_version.py "$RELEASE_REF"
36
+
37
+ - name: Install build tools
38
+ run: |
39
+ python -m pip install --upgrade pip
40
+ python -m pip install build twine
41
+
42
+ - name: Build sdist and wheel
43
+ run: python -m build
44
+
45
+ - name: Check distributions
46
+ run: python -m twine check dist/*
47
+
48
+ - name: Upload distribution artifact
49
+ uses: actions/upload-artifact@v5
50
+ with:
51
+ name: python-package-distributions
52
+ path: dist/
53
+
54
+ publish-pypi:
55
+ name: Publish distribution to PyPI
56
+ needs: build
57
+ runs-on: ubuntu-latest
58
+
59
+ environment:
60
+ name: pypi
61
+ url: https://pypi.org/p/certsf
62
+
63
+ permissions:
64
+ contents: read
65
+ id-token: write
66
+
67
+ steps:
68
+ - name: Download distribution artifact
69
+ uses: actions/download-artifact@v6
70
+ with:
71
+ name: python-package-distributions
72
+ path: dist/
73
+
74
+ - name: Publish to PyPI
75
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,72 @@
1
+ name: publish-testpypi
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ ref:
7
+ description: "Git ref or tag to publish"
8
+ required: true
9
+ default: "v0.1.0"
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ build:
16
+ name: Build distribution
17
+ runs-on: ubuntu-latest
18
+
19
+ steps:
20
+ - uses: actions/checkout@v6
21
+ with:
22
+ ref: ${{ inputs.ref }}
23
+ persist-credentials: false
24
+
25
+ - uses: actions/setup-python@v6
26
+ with:
27
+ python-version: "3.12"
28
+
29
+ - name: Check release tag matches package version
30
+ run: python scripts/check_release_version.py "${{ inputs.ref }}"
31
+
32
+ - name: Install build tools
33
+ run: |
34
+ python -m pip install --upgrade pip
35
+ python -m pip install build twine
36
+
37
+ - name: Build sdist and wheel
38
+ run: python -m build
39
+
40
+ - name: Check distributions
41
+ run: python -m twine check dist/*
42
+
43
+ - name: Upload distribution artifact
44
+ uses: actions/upload-artifact@v5
45
+ with:
46
+ name: python-package-distributions
47
+ path: dist/
48
+
49
+ publish-testpypi:
50
+ name: Publish distribution to TestPyPI
51
+ needs: build
52
+ runs-on: ubuntu-latest
53
+
54
+ environment:
55
+ name: testpypi
56
+ url: https://test.pypi.org/p/certsf
57
+
58
+ permissions:
59
+ contents: read
60
+ id-token: write
61
+
62
+ steps:
63
+ - name: Download distribution artifact
64
+ uses: actions/download-artifact@v6
65
+ with:
66
+ name: python-package-distributions
67
+ path: dist/
68
+
69
+ - name: Publish to TestPyPI
70
+ uses: pypa/gh-action-pypi-publish@release/v1
71
+ with:
72
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,117 @@
1
+ name: pypi-smoke
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ version:
7
+ description: "Published certsf version to test"
8
+ required: true
9
+ default: "0.1.0a3"
10
+ schedule:
11
+ - cron: "0 3 * * 1"
12
+
13
+ jobs:
14
+ smoke:
15
+ name: pypi-smoke / ${{ matrix.python-version }} ${{ matrix.extras || 'base' }}
16
+ runs-on: ubuntu-latest
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ python-version: ["3.10", "3.11", "3.12"]
21
+ extras: ["", "[certified]"]
22
+
23
+ steps:
24
+ - uses: actions/setup-python@v6
25
+ with:
26
+ python-version: ${{ matrix.python-version }}
27
+
28
+ - name: Install from PyPI
29
+ run: |
30
+ python -m pip install --upgrade pip
31
+ python -m pip install --pre "certsf${{ matrix.extras }}==${{ inputs.version || '0.1.0a3' }}"
32
+
33
+ - name: Smoke test import and calls
34
+ run: |
35
+ python - <<'PY'
36
+ import sysconfig
37
+ from pathlib import Path
38
+
39
+ import certsf
40
+ from certsf import ai, besselj, gamma, pcfu
41
+
42
+ certsf_path = Path(certsf.__file__).resolve()
43
+ install_paths = [
44
+ Path(sysconfig.get_paths()[key]).resolve()
45
+ for key in ("purelib", "platlib")
46
+ ]
47
+ assert any(certsf_path.is_relative_to(path) for path in install_paths), certsf_path
48
+
49
+ print(certsf.__all__)
50
+ print(certsf_path)
51
+ print(gamma("3.2", mode="fast").to_mcp_dict())
52
+ print(ai("1.0", mode="high_precision", dps=60).to_mcp_dict())
53
+ print(besselj("2", "4.0", mode="fast").to_mcp_dict())
54
+ print(pcfu("2.5", "1.25", mode="high_precision", dps=60).to_mcp_dict())
55
+ PY
56
+
57
+ - name: Certified smoke calls
58
+ if: matrix.extras == '[certified]'
59
+ run: |
60
+ python - <<'PY'
61
+ from certsf import ai, besselj, gamma, pcfu
62
+
63
+ cases = [
64
+ gamma("3.2", mode="certified", dps=50),
65
+ ai("1.0", mode="certified", dps=50),
66
+ besselj("2", "4.0", mode="certified", dps=50),
67
+ pcfu("2.5", "1.25", mode="certified", dps=50),
68
+ ]
69
+
70
+ for result in cases:
71
+ print(result.to_mcp_dict())
72
+ assert result.certified
73
+ PY
74
+
75
+ mcp-smoke:
76
+ name: pypi-smoke / ${{ matrix.python-version }} mcp-certified
77
+ runs-on: ubuntu-latest
78
+ strategy:
79
+ fail-fast: false
80
+ matrix:
81
+ python-version: ["3.10", "3.11", "3.12"]
82
+
83
+ steps:
84
+ - uses: actions/setup-python@v6
85
+ with:
86
+ python-version: ${{ matrix.python-version }}
87
+
88
+ - name: Install MCP extra from PyPI
89
+ run: |
90
+ python -m pip install --upgrade pip
91
+ python -m pip install --pre "certsf[mcp,certified]==${{ inputs.version || '0.1.0a3' }}"
92
+
93
+ - name: MCP smoke test
94
+ run: |
95
+ python - <<'PY'
96
+ import sysconfig
97
+ from pathlib import Path
98
+
99
+ import certsf
100
+ from certsf.mcp_server import build_server, special_gamma
101
+
102
+ certsf_path = Path(certsf.__file__).resolve()
103
+ install_paths = [
104
+ Path(sysconfig.get_paths()[key]).resolve()
105
+ for key in ("purelib", "platlib")
106
+ ]
107
+ assert any(certsf_path.is_relative_to(path) for path in install_paths), certsf_path
108
+
109
+ result = special_gamma("3.2", mode="fast")
110
+
111
+ print(certsf_path)
112
+ print(build_server)
113
+ print(result)
114
+ assert callable(build_server)
115
+ assert isinstance(result, dict)
116
+ assert result["function"] == "gamma"
117
+ PY
@@ -0,0 +1,47 @@
1
+ name: release-checks
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ package:
9
+ name: release-checks / package
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v6
13
+ - uses: actions/setup-python@v6
14
+ with:
15
+ python-version: "3.12"
16
+ - name: Install build tooling
17
+ run: |
18
+ python -m pip install --upgrade pip
19
+ python -m pip install build twine
20
+ - name: Build sdist and wheel
21
+ run: python -m build
22
+ - name: Check package metadata
23
+ run: python -m twine check dist/*
24
+ - name: Install built wheel
25
+ run: python -m pip install dist/*.whl
26
+ - name: Import installed package
27
+ run: python -c "import certsf; print(certsf.__all__)"
28
+
29
+ lint-type:
30
+ name: release-checks / lint-type
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - uses: actions/checkout@v6
34
+ - uses: actions/setup-python@v6
35
+ with:
36
+ python-version: "3.12"
37
+ - name: Install static-analysis tooling
38
+ run: |
39
+ python -m pip install --upgrade pip
40
+ python -m pip install -e ".[dev]"
41
+ python -m pip install pyright
42
+ - name: Run ruff
43
+ run: ruff check .
44
+ - name: Run pyright
45
+ run: pyright src --pythonpath "$(which python)"
46
+ - name: Check release claims
47
+ run: python -m pytest tests/test_release_claims.py
@@ -0,0 +1,74 @@
1
+ name: tests
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ package-build:
9
+ name: tests / package-build
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v6
13
+ - uses: actions/setup-python@v6
14
+ with:
15
+ python-version: "3.12"
16
+ - name: Install build backend
17
+ run: |
18
+ python -m pip install --upgrade pip
19
+ python -m pip install build
20
+ - name: Build sdist and wheel
21
+ run: python -m build
22
+
23
+ lint-type:
24
+ name: tests / lint-type
25
+ runs-on: ubuntu-latest
26
+ steps:
27
+ - uses: actions/checkout@v6
28
+ - uses: actions/setup-python@v6
29
+ with:
30
+ python-version: "3.12"
31
+ - name: Install package and dev dependencies
32
+ run: |
33
+ python -m pip install --upgrade pip
34
+ python -m pip install -e ".[dev]"
35
+ - name: Run ruff
36
+ run: python -m ruff check src tests examples
37
+ - name: Run mypy
38
+ run: python -m mypy
39
+
40
+ pytest-certified:
41
+ name: tests / pytest-certified (${{ matrix.python-version }})
42
+ runs-on: ubuntu-latest
43
+ strategy:
44
+ matrix:
45
+ python-version: ["3.10", "3.11", "3.12"]
46
+ steps:
47
+ - uses: actions/checkout@v6
48
+ - uses: actions/setup-python@v6
49
+ with:
50
+ python-version: ${{ matrix.python-version }}
51
+ - name: Install package and test dependencies
52
+ run: |
53
+ python -m pip install --upgrade pip
54
+ python -m pip install -e ".[test,certified]"
55
+ - name: Run tests
56
+ run: python -m pytest
57
+
58
+ pytest-base:
59
+ name: tests / pytest-base (${{ matrix.python-version }})
60
+ runs-on: ubuntu-latest
61
+ strategy:
62
+ matrix:
63
+ python-version: ["3.10", "3.11", "3.12"]
64
+ steps:
65
+ - uses: actions/checkout@v6
66
+ - uses: actions/setup-python@v6
67
+ with:
68
+ python-version: ${{ matrix.python-version }}
69
+ - name: Install package and test dependencies
70
+ run: |
71
+ python -m pip install --upgrade pip
72
+ python -m pip install -e ".[test]"
73
+ - name: Run tests
74
+ run: python -m pytest
@@ -0,0 +1,20 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+
5
+ .pytest_cache/
6
+ .ruff_cache/
7
+ .mypy_cache/
8
+ .coverage
9
+ htmlcov/
10
+
11
+ .venv/
12
+ venv/
13
+ env/
14
+
15
+ build/
16
+ dist/
17
+ *.egg-info/
18
+
19
+ .DS_Store
20
+ Thumbs.db
@@ -0,0 +1,43 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 - 2026-05-08
4
+
5
+ - Planned the first non-prerelease package release with the same frozen public
6
+ API as `0.1.0-alpha.3`.
7
+ - No mathematical implementation changes from `0.1.0-alpha.3`, no
8
+ public-wrapper expansion, and no certification-claim broadening are included.
9
+ - The parabolic-cylinder formula layer remains `experimental_formula`.
10
+ - The release includes PyPI publishing guardrails, fresh-install smoke tests,
11
+ deterministic audit grids, and external-reference fixture containment tests.
12
+
13
+ ## 0.1.0-alpha.3 - 2026-05-08
14
+
15
+ - Added deterministic parabolic-cylinder formula-audit grids for recurrence,
16
+ connection-formula, derivative, branch-side, cancellation, and stress
17
+ coverage.
18
+ - Added external-reference fixture containment tests for selected gamma, Airy,
19
+ Bessel, and parabolic-cylinder certified results.
20
+ - Hardened release workflows by making TestPyPI manual-only and adding a
21
+ tag/version parity guard before publishing builds.
22
+ - No mathematical implementation changes, public-wrapper expansion, or
23
+ certification-claim broadening are included.
24
+
25
+ ## 0.1.0-alpha.2 - 2026-05-08
26
+
27
+ - Added TestPyPI and PyPI trusted-publishing workflows, plus a PyPI smoke
28
+ workflow for fresh prerelease install verification.
29
+ - Added release-claim guardrails, frozen-scope checks, branch-protection check
30
+ naming, and v0.1.x audit coverage to keep the 0.1.0 certified scope frozen.
31
+ - Documented PyPI installation and the post-release verification evidence for
32
+ `v0.1.0-alpha.1`.
33
+ - Hardened GitHub Actions compatibility and PyPI smoke workflow behavior without
34
+ changing mathematical implementations, adding public wrappers, or broadening
35
+ certification claims.
36
+
37
+ ## 0.1.0-alpha.1 - 2026-05-07
38
+
39
+ - Added special-function wrappers for gamma, Airy, Bessel, and parabolic-cylinder families, with the
40
+ parabolic-cylinder formula layer marked experimental.
41
+ - Added SciPy fast mode, mpmath high-precision mode, and optional python-flint certified mode.
42
+ - Added structured `SFResult` diagnostics, MCP wrappers, CI, and certification documentation.
43
+ - Hardened dispatcher v2 with an explicit backend method registry and API/MCP coverage checks.
@@ -0,0 +1,10 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use certsf in research, please cite it using this metadata."
3
+ title: "certsf: Alpha special-function wrappers with explicit certification diagnostics"
4
+ version: "0.1.0"
5
+ date-released: 2026-05-08
6
+ authors:
7
+ - family-names: Lee
8
+ given-names: Yutian
9
+ repository-code: "https://github.com/yutianlee/certsf"
10
+ license: MIT
certsf-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Yutian Lee
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.