homology-operator 0.0.2__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 (99) hide show
  1. homology_operator-0.0.2/.gitattributes +2 -0
  2. homology_operator-0.0.2/.github/workflows/docs.yml +56 -0
  3. homology_operator-0.0.2/.github/workflows/native.yml +67 -0
  4. homology_operator-0.0.2/.github/workflows/oracle.yml +33 -0
  5. homology_operator-0.0.2/.github/workflows/reference.yml +48 -0
  6. homology_operator-0.0.2/.github/workflows/release.yml +65 -0
  7. homology_operator-0.0.2/.gitignore +7 -0
  8. homology_operator-0.0.2/AGENTS.md +46 -0
  9. homology_operator-0.0.2/CITATION.cff +11 -0
  10. homology_operator-0.0.2/CONTRIBUTING.en.md +29 -0
  11. homology_operator-0.0.2/CONTRIBUTING.md +51 -0
  12. homology_operator-0.0.2/LICENSE +21 -0
  13. homology_operator-0.0.2/PKG-INFO +250 -0
  14. homology_operator-0.0.2/README.en.md +228 -0
  15. homology_operator-0.0.2/README.md +206 -0
  16. homology_operator-0.0.2/THIRD_PARTY_NOTICES.md +23 -0
  17. homology_operator-0.0.2/docs/ARCHITECTURE.md +150 -0
  18. homology_operator-0.0.2/docs/FIXTURES.md +54 -0
  19. homology_operator-0.0.2/docs/INTERFACE.md +379 -0
  20. homology_operator-0.0.2/docs/MATHEMATICS.md +435 -0
  21. homology_operator-0.0.2/docs/README.md +25 -0
  22. homology_operator-0.0.2/docs/RESULT_MODEL.md +222 -0
  23. homology_operator-0.0.2/docs/SOLVER_CONTRACT.md +101 -0
  24. homology_operator-0.0.2/docs/VALIDATION.md +137 -0
  25. homology_operator-0.0.2/docs/conf.py +104 -0
  26. homology_operator-0.0.2/docs/en/ARCHITECTURE.md +122 -0
  27. homology_operator-0.0.2/docs/en/INTERFACE.md +186 -0
  28. homology_operator-0.0.2/docs/en/MATHEMATICS.md +476 -0
  29. homology_operator-0.0.2/docs/en/RESULT_MODEL.md +91 -0
  30. homology_operator-0.0.2/docs/en/SOLVER_CONTRACT.md +129 -0
  31. homology_operator-0.0.2/docs/en/USAGE.md +16 -0
  32. homology_operator-0.0.2/docs/en/VALIDATION.md +118 -0
  33. homology_operator-0.0.2/docs/en/conf.py +15 -0
  34. homology_operator-0.0.2/docs/en/getting-started/installation.md +59 -0
  35. homology_operator-0.0.2/docs/en/getting-started/quickstart.md +64 -0
  36. homology_operator-0.0.2/docs/en/guide/filtration.md +33 -0
  37. homology_operator-0.0.2/docs/en/guide/input-semantics.md +39 -0
  38. homology_operator-0.0.2/docs/en/guide/native.md +52 -0
  39. homology_operator-0.0.2/docs/en/guide/single-scale.md +117 -0
  40. homology_operator-0.0.2/docs/en/index.md +188 -0
  41. homology_operator-0.0.2/docs/en/platforms.md +17 -0
  42. homology_operator-0.0.2/docs/getting-started/installation.md +57 -0
  43. homology_operator-0.0.2/docs/getting-started/quickstart.md +62 -0
  44. homology_operator-0.0.2/docs/guide/filtration.md +29 -0
  45. homology_operator-0.0.2/docs/guide/input-semantics.md +26 -0
  46. homology_operator-0.0.2/docs/guide/native.md +40 -0
  47. homology_operator-0.0.2/docs/guide/single-scale.md +115 -0
  48. homology_operator-0.0.2/docs/index.md +176 -0
  49. homology_operator-0.0.2/docs/platforms.md +15 -0
  50. homology_operator-0.0.2/docs/requirements.txt +5 -0
  51. homology_operator-0.0.2/examples/filtration.py +76 -0
  52. homology_operator-0.0.2/examples/single_scale.py +52 -0
  53. homology_operator-0.0.2/native/Cargo.lock +132 -0
  54. homology_operator-0.0.2/native/Cargo.toml +14 -0
  55. homology_operator-0.0.2/native/pyproject.toml +14 -0
  56. homology_operator-0.0.2/native/rust-toolchain.toml +4 -0
  57. homology_operator-0.0.2/native/src/lib.rs +281 -0
  58. homology_operator-0.0.2/native/src/packed.rs +984 -0
  59. homology_operator-0.0.2/pyproject.toml +52 -0
  60. homology_operator-0.0.2/scripts/check_docs.ps1 +107 -0
  61. homology_operator-0.0.2/src/homology_operator/__init__.py +49 -0
  62. homology_operator-0.0.2/src/homology_operator/algebra.py +391 -0
  63. homology_operator-0.0.2/src/homology_operator/chain.py +319 -0
  64. homology_operator-0.0.2/src/homology_operator/family.py +1122 -0
  65. homology_operator-0.0.2/src/homology_operator/native.py +908 -0
  66. homology_operator-0.0.2/src/homology_operator/operator.py +336 -0
  67. homology_operator-0.0.2/src/homology_operator/result.py +587 -0
  68. homology_operator-0.0.2/src/homology_operator/solver.py +1466 -0
  69. homology_operator-0.0.2/src/homology_operator/validation.py +936 -0
  70. homology_operator-0.0.2/tests/fixtures/legacy_results.json +3942 -0
  71. homology_operator-0.0.2/tests/fixtures/oracle_corpus.json +14491 -0
  72. homology_operator-0.0.2/tests/fixtures/reference.json +5689 -0
  73. homology_operator-0.0.2/tests/fixtures/simplicial.json +1309 -0
  74. homology_operator-0.0.2/tests/fixtures/solver_reference.json +519 -0
  75. homology_operator-0.0.2/tests/oracle/gudhi_oracle.py +279 -0
  76. homology_operator-0.0.2/tests/oracle/reference.py +340 -0
  77. homology_operator-0.0.2/tests/oracle/simplicial.py +514 -0
  78. homology_operator-0.0.2/tests/test_algebra.py +163 -0
  79. homology_operator-0.0.2/tests/test_backend_integration.py +252 -0
  80. homology_operator-0.0.2/tests/test_chain.py +137 -0
  81. homology_operator-0.0.2/tests/test_family.py +722 -0
  82. homology_operator-0.0.2/tests/test_family_joint.py +414 -0
  83. homology_operator-0.0.2/tests/test_geometry.py +110 -0
  84. homology_operator-0.0.2/tests/test_gudhi_oracle.py +110 -0
  85. homology_operator-0.0.2/tests/test_integration.py +321 -0
  86. homology_operator-0.0.2/tests/test_joint.py +310 -0
  87. homology_operator-0.0.2/tests/test_legacy_results.py +239 -0
  88. homology_operator-0.0.2/tests/test_native.py +1246 -0
  89. homology_operator-0.0.2/tests/test_operator.py +123 -0
  90. homology_operator-0.0.2/tests/test_oracle_corpus.py +96 -0
  91. homology_operator-0.0.2/tests/test_package.py +39 -0
  92. homology_operator-0.0.2/tests/test_rank2.py +389 -0
  93. homology_operator-0.0.2/tests/test_result.py +338 -0
  94. homology_operator-0.0.2/tests/test_simplicial_inputs.py +174 -0
  95. homology_operator-0.0.2/tests/test_solver.py +1279 -0
  96. homology_operator-0.0.2/tests/test_stretch.py +102 -0
  97. homology_operator-0.0.2/tests/test_structured.py +331 -0
  98. homology_operator-0.0.2/tests/test_validation.py +191 -0
  99. homology_operator-0.0.2/uv.lock +380 -0
@@ -0,0 +1,2 @@
1
+ # Keep regression fixture bytes stable across platforms.
2
+ tests/fixtures/*.json text eol=lf
@@ -0,0 +1,56 @@
1
+ name: Documentation and Pages
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: pages-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ docs:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ - uses: actions/setup-python@v5
22
+ with:
23
+ python-version: "3.12"
24
+ - name: Install documentation dependencies
25
+ run: python -m pip install -r docs/requirements.txt
26
+ - name: Check Markdown source links
27
+ run: pwsh -NoProfile -File ./scripts/check_docs.ps1
28
+ - name: Build Chinese documentation
29
+ run: python -m sphinx -E -n -W --keep-going -b html docs .task-artifacts/docs-site
30
+ - name: Build English documentation
31
+ run: python -m sphinx -E -n -W --keep-going -b html docs/en .task-artifacts/docs-site/en
32
+ - run: touch .task-artifacts/docs-site/.nojekyll
33
+ - uses: actions/upload-artifact@v4
34
+ with:
35
+ name: documentation-site
36
+ path: .task-artifacts/docs-site
37
+ if-no-files-found: error
38
+ - uses: actions/upload-pages-artifact@v3
39
+ if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
40
+ with:
41
+ path: .task-artifacts/docs-site
42
+
43
+ deploy:
44
+ if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
45
+ needs: docs
46
+ runs-on: ubuntu-latest
47
+ permissions:
48
+ pages: write
49
+ id-token: write
50
+ environment:
51
+ name: github-pages
52
+ url: ${{ steps.deployment.outputs.page_url }}
53
+ steps:
54
+ - name: Deploy GitHub Pages
55
+ id: deployment
56
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,67 @@
1
+ name: Native checks
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ native:
13
+ strategy:
14
+ matrix:
15
+ include:
16
+ - os: windows-latest
17
+ python: "3.10"
18
+ - os: ubuntu-latest
19
+ python: "3.12"
20
+ runs-on: ${{ matrix.os }}
21
+ env:
22
+ RUSTUP_TOOLCHAIN: "1.98.1"
23
+ defaults:
24
+ run:
25
+ shell: pwsh
26
+ steps:
27
+ - uses: actions/checkout@v4
28
+ - uses: astral-sh/setup-uv@v6
29
+ with:
30
+ version: "0.11.5"
31
+ - run: uv sync --locked --group oracle --python ${{ matrix.python }}
32
+ - run: rustup toolchain install 1.98.1 --profile minimal --component rustfmt --component clippy
33
+ - run: cargo fmt --manifest-path native/Cargo.toml --check
34
+ - run: cargo clippy --manifest-path native/Cargo.toml --locked --all-targets -- -D warnings
35
+ - name: Build and install optional release wheel
36
+ run: |
37
+ $pythonPath = uv run --locked python -c "import sys; print(sys.executable)"
38
+ uv tool run --from maturin==1.15.0 maturin build --manifest-path native/Cargo.toml --release --locked --interpreter $pythonPath --out .task-artifacts/native-wheels
39
+ if ($LASTEXITCODE) { exit $LASTEXITCODE }
40
+ $wheel = Get-ChildItem .task-artifacts/native-wheels/*.whl
41
+ uv pip install --python $pythonPath $wheel.FullName
42
+ exit $LASTEXITCODE
43
+ - name: Require native differential and regression tests
44
+ env:
45
+ HOMOLOGY_NATIVE_REQUIRED: "1"
46
+ HOMOLOGY_GUDHI_REQUIRED: "1"
47
+ run: uv run --locked --no-sync python -m unittest discover -s tests -v
48
+ - name: Check installed reference and native wheels in isolation
49
+ env:
50
+ HOMOLOGY_NATIVE_REQUIRED: "1"
51
+ run: |
52
+ $pythonPath = uv run --locked --no-sync python -c "import sys; print(sys.executable)"
53
+ uv build --no-build-isolation
54
+ if ($LASTEXITCODE) { exit $LASTEXITCODE }
55
+ uv venv .task-artifacts/installed-env --python $pythonPath
56
+ if ($LASTEXITCODE) { exit $LASTEXITCODE }
57
+ $installedPython = if ($IsWindows) { '.task-artifacts/installed-env/Scripts/python.exe' } else { '.task-artifacts/installed-env/bin/python' }
58
+ $referenceWheel = Get-ChildItem dist/*.whl
59
+ $nativeWheel = Get-ChildItem .task-artifacts/native-wheels/*.whl
60
+ uv pip install --python $installedPython $referenceWheel.FullName $nativeWheel.FullName
61
+ if ($LASTEXITCODE) { exit $LASTEXITCODE }
62
+ & $installedPython -I -c "from homology_operator.native import backend_info; info = backend_info(); assert info['native'] == 'Available', info; print(info)"
63
+ if ($LASTEXITCODE) { exit $LASTEXITCODE }
64
+ & $installedPython -I -m unittest discover -s tests -p test_integration.py -v
65
+ if ($LASTEXITCODE) { exit $LASTEXITCODE }
66
+ & $installedPython -I -m unittest discover -s tests -p test_legacy_results.py -v
67
+ exit $LASTEXITCODE
@@ -0,0 +1,33 @@
1
+ name: GUDHI oracle checks
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ oracle:
13
+ strategy:
14
+ matrix:
15
+ include:
16
+ - os: windows-latest
17
+ python: "3.12"
18
+ - os: ubuntu-latest
19
+ python: "3.10"
20
+ - os: ubuntu-latest
21
+ python: "3.12"
22
+ runs-on: ${{ matrix.os }}
23
+ env:
24
+ HOMOLOGY_GUDHI_REQUIRED: "1"
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+ - uses: astral-sh/setup-uv@v6
28
+ with:
29
+ version: "0.11.5"
30
+ - run: uv sync --locked --group oracle --group oracle-secondary --python ${{ matrix.python }}
31
+ - run: uv run --locked --group oracle --group oracle-secondary python -m unittest discover -s tests -p test_simplicial_inputs.py -v
32
+ - run: uv run --locked --group oracle --group oracle-secondary python -m unittest discover -s tests -p test_gudhi_oracle.py -v
33
+ - run: uv run --locked --group oracle --group oracle-secondary python -m unittest discover -s tests -p test_oracle_corpus.py -v
@@ -0,0 +1,48 @@
1
+ name: Reference checks
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ reference:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ matrix:
16
+ python: ["3.10", "3.12"]
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
21
+ - uses: astral-sh/setup-uv@v6
22
+ with:
23
+ version: "0.11.5"
24
+ - run: uv sync --locked --python ${{ matrix.python }}
25
+ - run: uv run --locked python -m unittest discover -s tests -v
26
+ - run: uv run --locked python examples/single_scale.py
27
+ - run: uv run --locked python examples/filtration.py
28
+ - run: uv run --locked ruff check .
29
+ - run: uv run --locked ruff format --check .
30
+ - run: uv build --no-build-isolation
31
+ - name: Check wheel in an isolated environment
32
+ shell: bash
33
+ run: |
34
+ uv venv .task-artifacts/wheel-env --python ${{ matrix.python }}
35
+ uv pip install --python .task-artifacts/wheel-env/bin/python dist/*.whl
36
+ .task-artifacts/wheel-env/bin/python -I -c "import homology_operator; print(homology_operator.__version__)"
37
+ .task-artifacts/wheel-env/bin/python -I -c "from homology_operator.native import backend_info; info=backend_info(); assert info['native']=='Unavailable', info; print(info)"
38
+ .task-artifacts/wheel-env/bin/python -I -m unittest discover -s tests -p test_integration.py -v
39
+ .task-artifacts/wheel-env/bin/python -I -m unittest discover -s tests -p test_legacy_results.py -v
40
+ .task-artifacts/wheel-env/bin/python -I -m unittest discover -s tests -p test_backend_integration.py -v
41
+ - run: pwsh -NoProfile -File ./scripts/check_docs.ps1
42
+ - run: git diff --check
43
+ - name: Check whitespace in the complete pull request
44
+ if: github.event_name == 'pull_request'
45
+ env:
46
+ BASE_SHA: ${{ github.event.pull_request.base.sha }}
47
+ HEAD_SHA: ${{ github.event.pull_request.head.sha }}
48
+ run: git diff --check "$BASE_SHA...$HEAD_SHA"
@@ -0,0 +1,65 @@
1
+ name: Publish Python package
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ concurrency:
11
+ group: pypi-${{ github.ref }}
12
+ cancel-in-progress: false
13
+
14
+ jobs:
15
+ build:
16
+ runs-on: ubuntu-latest
17
+ strategy:
18
+ matrix:
19
+ python: ["3.10", "3.12"]
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - uses: astral-sh/setup-uv@v6
23
+ with:
24
+ version: "0.11.5"
25
+ - run: uv sync --locked --python ${{ matrix.python }}
26
+ - name: Match release tag to package version
27
+ env:
28
+ RELEASE_TAG: ${{ github.ref_name }}
29
+ run: uv run --locked python -c "import os, homology_operator; assert os.environ['RELEASE_TAG'] == 'v' + homology_operator.__version__"
30
+ - run: uv run --locked python -m unittest discover -s tests -v
31
+ - run: uv run --locked python examples/single_scale.py
32
+ - run: uv run --locked python examples/filtration.py
33
+ - run: uv run --locked ruff check .
34
+ - run: uv run --locked ruff format --check .
35
+ - run: pwsh -NoProfile -File ./scripts/check_docs.ps1
36
+ - run: uv build --no-build-isolation
37
+ - run: uv tool run --from twine==6.2.0 twine check --strict dist/*
38
+ - name: Test the installed wheel independently of the source tree
39
+ run: |
40
+ uv venv .task-artifacts/release-env --python ${{ matrix.python }}
41
+ uv pip install --python .task-artifacts/release-env/bin/python dist/*.whl
42
+ .task-artifacts/release-env/bin/python -I -c "import homology_operator; from homology_operator.native import backend_info; assert backend_info()['native'] == 'Unavailable'; print(homology_operator.__version__)"
43
+ .task-artifacts/release-env/bin/python -I -m unittest discover -s tests -v
44
+ - uses: actions/upload-artifact@v4
45
+ if: matrix.python == '3.10'
46
+ with:
47
+ name: python-distributions
48
+ path: dist/*
49
+ if-no-files-found: error
50
+
51
+ publish:
52
+ needs: build
53
+ runs-on: ubuntu-latest
54
+ environment:
55
+ name: pypi
56
+ url: https://pypi.org/project/homology-operator/
57
+ permissions:
58
+ id-token: write
59
+ steps:
60
+ - uses: actions/download-artifact@v4
61
+ with:
62
+ name: python-distributions
63
+ path: dist/
64
+ - name: Publish with PyPI Trusted Publishing
65
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,7 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.py[cod]
4
+ .ruff_cache/
5
+ dist/
6
+ .task-artifacts/
7
+ native/target/
@@ -0,0 +1,46 @@
1
+ # homology-operator 项目约定
2
+
3
+ 默认使用中文回答。修改前阅读 README、docs 与相关代码,沿用现有文件和类型;
4
+ 修改后检查文档、注释、测试和示例。做最小可验证修改,不覆盖用户已有工作。
5
+
6
+ ## 产品范围
7
+
8
+ 仓库保留 Python 公共接口、Rust 计算后端、产品回归测试、示例和双语文档。
9
+ 研究原型、阶段计划、历史实验原值/报告与一次性测量工具不进入当前产品目录。
10
+ `src/homology_operator/` 和 `native/src/` 都是维护中的产品代码。
11
+ reference 运行时仅依赖 Python 3.10+ 标准库;Rust 扩展单独构建,支持域见 docs/INTERFACE.md。
12
+
13
+ ## 数学与工程红线
14
+
15
+ - 输入为固定次数的带基链窗口 `C_{k+1} --D--> C_k --A--> C_{k-1}`,在 F2 上验证维数、`AD=0` 与正权重。
16
+ - 同一个 `HomologyOperator` 的拓扑、代表、距离、支撑和 stretch 必须来自同一个 `P`,保留 `input_id`、`basis_id`、`weight_id`、`projection_id`、`operator_id` 和 `solver_run_id`。
17
+ - 任何 solver 输出进入算子前,独立验证 `P²=P`、`AP=0`、`PD=0` 以及循环同调保持。前三项不能替代最后一项;零投影也可能满足前三项。
18
+ - `selected_mass(z)=m_w(Pz)` 不能被命名或序列化为真实最短类质量。合法投影、当前 objective 的精确计算、全局最优认证分别报告。
19
+ - F2 代数精确不代表浮点权重下的 objective 精确。`ExactOptimal` 必须有最优性证书;资源耗尽、不可用、未计算、空定义域与合法零值分别表达。
20
+ - 同调类查询默认只接受循环;原始 `project`、`apply_operator` 作用于全部链。不得静默把非循环解释成同调类。
21
+ - Persistence 从 `OperatorFamily` 的 `T_ij=P_j J_ij|ker(L_i)` 和 rank invariant 读取。独立 PH reduction 只允许作为 `tests/oracle/` 或性能对照,不能填充主结果。
22
+ - 理论来源固定在文档列出的研究提交;研究仓库的代码、依赖和验证成绩不能当作本仓库已有能力。迁移 fixture 必须记录来源和 hash。
23
+
24
+
25
+ ## 文档与验证
26
+
27
+ - README 与 docs/index.md:安装、能力、用法和站点入口。
28
+ - docs/INTERFACE.md:实际 API、支持域与 native 安装。
29
+ - docs/ARCHITECTURE.md、docs/SOLVER_CONTRACT.md:数学定义、模块边界、算法与认证。
30
+ - docs/RESULT_MODEL.md:身份、状态、几何语义、序列化与恢复。
31
+ - docs/FIXTURES.md:产品测试输入与来源。
32
+ - docs/VALIDATION.md:reference/native/oracle、打包、文档与 CI 的真实命令。
33
+
34
+ 普通文档改动运行:
35
+
36
+ ```powershell
37
+ pwsh -NoProfile -File ./scripts/check_docs.ps1
38
+ git diff --check
39
+ ```
40
+
41
+ 数学、投影、solver、transport、身份或恢复改动补独立不变量与失败输入测试。
42
+ Rust 改动重建扩展并强制 native 差分;未安装扩展的跳过不能当作 native 通过。
43
+ 需要保留的产品兼容性样本与 oracle 位于 tests/fixtures 和 tests/oracle。
44
+ 临时构建、测量和运行日志写入忽略的 .task-artifacts,不提交到产品目录。
45
+ 最终报告实际修改、验证、跳过项和剩余限制,区分本地与远端 CI。
46
+ 具体数学契约优先于通用 skills;明确的用户要求优先。
@@ -0,0 +1,11 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use homology-operator in research, please cite the exact software version and commit."
3
+ title: "homology-operator: boundary-native F2 homology operators"
4
+ type: software
5
+ version: 0.0.2
6
+ license: MIT
7
+ authors:
8
+ - name: "homology-operator contributors"
9
+ repository-code: "https://github.com/proffitteoy/homology-operator"
10
+ url: "https://github.com/proffitteoy/homology-operator"
11
+ abstract: "Homology operators from based F2 chain windows, with same-projection topology, representatives, weighted geometry, and finite-filtration transport."
@@ -0,0 +1,29 @@
1
+ # Contributing to homology-operator
2
+
3
+ [中文](CONTRIBUTING.md) · [Development](docs/en/VALIDATION.md)
4
+
5
+ Documentation, examples, input validation, correctness, performance and platform
6
+ improvements are welcome. Read [project conventions](AGENTS.md) and the relevant
7
+ mathematical contract first. Keep changes small and describe the trigger, final
8
+ behavior, checks actually run, skipped checks and remaining limitations.
9
+
10
+ 1. Update both language entries, relevant API docs, comments, examples and tests
11
+ for public behavior changes.
12
+ 2. Validate projection legality independently, including cycle homology preservation.
13
+ Feasibility, current objective and global optimality are separate claims.
14
+ 3. Keep `selected_mass` distinct from true minimum class mass. Independent PH and
15
+ GUDHI comparisons must not fill production results.
16
+ 4. For native changes, rebuild the matching extension and require native tests.
17
+ 5. Bind performance claims to source/build/input, arithmetic, certificate and budget,
18
+ and retain complete costs, failures and regressions.
19
+ 6. Do not commit environments, build caches, wheels or temporary measurements.
20
+ Keep temporary measurements and research material in ignored directories.
21
+
22
+ At minimum, run the applicable checks from [development](docs/en/VALIDATION.md).
23
+ Documentation edits require source-link checks and both strict site builds;
24
+ modified Python snippets must actually run. Mathematical or serialization changes
25
+ need independent invariants and rejection/round-trip evidence.
26
+
27
+ Report problems through [GitHub Issues](https://github.com/proffitteoy/homology-operator/issues).
28
+ The project uses MIT; the 0.x compatibility policy and Trusted Publisher procedure
29
+ are in [public releases](docs/en/VALIDATION.md#public-releases).
@@ -0,0 +1,51 @@
1
+ # 为 homology-operator 贡献
2
+
3
+ [README](README.md) · [English](CONTRIBUTING.en.md) · [开发与验证](docs/VALIDATION.md)
4
+
5
+ 欢迎提交文档、示例、输入校验、正确性、性能和跨平台构建改进。
6
+ 开始前阅读 [项目约定](AGENTS.md)及改动领域的契约;提交小范围改动,说明触发条件、
7
+ 最终行为与实际运行的检查。问题与建议可提交到 [GitHub Issues](https://github.com/proffitteoy/homology-operator/issues)。
8
+
9
+ ## 开发环境
10
+
11
+ Python 3.10+ 和 uv;reference 运行时只依赖标准库。仓库根目录执行:
12
+
13
+ ```console
14
+ uv sync --locked --python 3.10
15
+ uv run --locked python -m unittest discover -s tests -v
16
+ uv run --locked ruff check .
17
+ uv run --locked ruff format --check .
18
+ pwsh -NoProfile -File ./scripts/check_docs.ps1
19
+ git diff --check
20
+ ```
21
+
22
+ 未安装扩展时 native 测试会明确跳过。改动 Rust 或 native 适配必须重建匹配扩展,
23
+ 并用 `HOMOLOGY_NATIVE_REQUIRED=1` 运行适用测试;命令见[验证说明](docs/VALIDATION.md)。
24
+ GUDHI 是可选测试 oracle,须使用锁定依赖并强制运行对应检查。
25
+
26
+ ## 修改与验收
27
+
28
+ | 改动 | 随改动提交的内容 |
29
+ | --- | --- |
30
+ | 文档或示例 | 更新实际入口;运行本地链接检查与严格站点构建;新增/修改代码片段实际执行 |
31
+ | 输入、F2 代数、投影或 solver | 独立不变量、失败输入、循环同调保持、认证与资源状态测试 |
32
+ | transport / barcode | composition、全区间 rank、独立 oracle 对拍、重复尺度与末端存活 |
33
+ | 身份、schema 或恢复 | round-trip、混用与篡改拒绝、旧格式兼容、合法零与缺失状态 |
34
+ | 性能 | 同输入/P/认证/预算的完整成本;源码、构建、环境、样本与失败/退化记录 |
35
+
36
+ 完整门槛以 [VALIDATION](docs/VALIDATION.md) 为准。请同步检查 API、注释、README、测试及示例。
37
+ 不将 `selected_mass` 表述为最短类质量,不将合法投影升级为最优认证,
38
+ 不以独立 PH reduction 或 GUDHI 输出填充主结果。
39
+
40
+ ## 文档站
41
+
42
+ 站点沿用现有 Markdown;Python 3.11+ 的文档依赖独立安装,命令见
43
+ [文档构建](docs/VALIDATION.md#文档站构建)。中英文公开入口变更需同步检查示例和能力边界。
44
+ 仓库只保留产品实现、测试、示例与文档;临时测量或调研材料放入忽略目录。
45
+
46
+ ## Pull request
47
+
48
+ 描述问题与最终行为,注明修改范围、实际验证、跳过项和剩余限制。
49
+ 涉及性能时链接可复现命令与绑定源码的证据;所有退化与失败一起公开。
50
+ 不要提交虚拟环境、构建缓存、wheel 或临时测量产物。
51
+ 0.x 发行的兼容政策和 Trusted Publisher 流程见[发行说明](docs/VALIDATION.md#公开发行)。
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 homology-operator contributors
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.