causasv 0.8.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 (62) hide show
  1. causasv-0.8.2/.github/dependabot.yml +26 -0
  2. causasv-0.8.2/.github/workflows/ci.yml +51 -0
  3. causasv-0.8.2/.github/workflows/release.yml +109 -0
  4. causasv-0.8.2/.github/workflows/security.yml +35 -0
  5. causasv-0.8.2/.gitignore +13 -0
  6. causasv-0.8.2/AGENTS.md +581 -0
  7. causasv-0.8.2/CHANGELOG.md +93 -0
  8. causasv-0.8.2/CITATION.cff +14 -0
  9. causasv-0.8.2/CONTRIBUTING.md +10 -0
  10. causasv-0.8.2/Cargo.lock +1028 -0
  11. causasv-0.8.2/Cargo.toml +41 -0
  12. causasv-0.8.2/LICENSE-APACHE +159 -0
  13. causasv-0.8.2/LICENSE-MIT +21 -0
  14. causasv-0.8.2/PKG-INFO +8 -0
  15. causasv-0.8.2/README.md +401 -0
  16. causasv-0.8.2/README_ja.md +347 -0
  17. causasv-0.8.2/README_zh.md +347 -0
  18. causasv-0.8.2/ROADMAP.md +45 -0
  19. causasv-0.8.2/SECURITY.md +45 -0
  20. causasv-0.8.2/benches/asv_bench.rs +428 -0
  21. causasv-0.8.2/causasv/__init__.py +16 -0
  22. causasv-0.8.2/causasv/helpers.py +273 -0
  23. causasv-0.8.2/docs/benchmarks.md +102 -0
  24. causasv-0.8.2/docs/correctness.md +99 -0
  25. causasv-0.8.2/examples/approximate_dag.rs +49 -0
  26. causasv-0.8.2/examples/basic.rs +29 -0
  27. causasv-0.8.2/examples/benchmark_batched_value_fn.py +72 -0
  28. causasv-0.8.2/examples/compare_shap_asv.py +66 -0
  29. causasv-0.8.2/examples/dag_sensitivity.py +52 -0
  30. causasv-0.8.2/examples/rooted_tree.rs +36 -0
  31. causasv-0.8.2/examples/sklearn_tabular.py +66 -0
  32. causasv-0.8.2/examples/stability_diagnostics.py +50 -0
  33. causasv-0.8.2/py/causasv/__init__.py +16 -0
  34. causasv-0.8.2/py/causasv/helpers.py +273 -0
  35. causasv-0.8.2/py/pyproject.toml +17 -0
  36. causasv-0.8.2/py/tests/test_basic.py +723 -0
  37. causasv-0.8.2/py/tests/test_ensemble.py +97 -0
  38. causasv-0.8.2/pyproject.toml +17 -0
  39. causasv-0.8.2/src/approx.rs +696 -0
  40. causasv-0.8.2/src/asv.rs +300 -0
  41. causasv-0.8.2/src/cache.rs +51 -0
  42. causasv-0.8.2/src/dag_dp.rs +156 -0
  43. causasv-0.8.2/src/dag_dp_sparse.rs +192 -0
  44. causasv-0.8.2/src/error.rs +23 -0
  45. causasv-0.8.2/src/graph.rs +140 -0
  46. causasv-0.8.2/src/lib.rs +51 -0
  47. causasv-0.8.2/src/numerics.rs +13 -0
  48. causasv-0.8.2/src/python.rs +762 -0
  49. causasv-0.8.2/src/sampler.rs +286 -0
  50. causasv-0.8.2/src/topo.rs +81 -0
  51. causasv-0.8.2/src/tree.rs +247 -0
  52. causasv-0.8.2/src/value_function.rs +7 -0
  53. causasv-0.8.2/tests/approx_accuracy_tests.rs +188 -0
  54. causasv-0.8.2/tests/approx_stability_tests.rs +93 -0
  55. causasv-0.8.2/tests/asv_bruteforce_tests.rs +293 -0
  56. causasv-0.8.2/tests/dag_dp_sparse_tests.rs +126 -0
  57. causasv-0.8.2/tests/dag_dp_tests.rs +110 -0
  58. causasv-0.8.2/tests/graph_tests.rs +113 -0
  59. causasv-0.8.2/tests/property_tests.rs +235 -0
  60. causasv-0.8.2/tests/sampler_tests.rs +154 -0
  61. causasv-0.8.2/tests/topo_tests.rs +116 -0
  62. causasv-0.8.2/tests/tree_exact_tests.rs +212 -0
@@ -0,0 +1,26 @@
1
+ version: 2
2
+
3
+ updates:
4
+ - package-ecosystem: "cargo"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ labels: ["dependencies", "rust"]
9
+ commit-message:
10
+ prefix: "deps(rust)"
11
+
12
+ - package-ecosystem: "pip"
13
+ directory: "/py"
14
+ schedule:
15
+ interval: "weekly"
16
+ labels: ["dependencies", "python"]
17
+ commit-message:
18
+ prefix: "deps(python)"
19
+
20
+ - package-ecosystem: "github-actions"
21
+ directory: "/"
22
+ schedule:
23
+ interval: "weekly"
24
+ labels: ["dependencies", "github-actions"]
25
+ commit-message:
26
+ prefix: "ci"
@@ -0,0 +1,51 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ rust:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v7
15
+ - uses: dtolnay/rust-toolchain@stable
16
+ - uses: Swatinem/rust-cache@v2
17
+ - run: cargo fmt --check
18
+ - run: cargo clippy --all-targets --all-features -- -D warnings
19
+ - run: cargo test --all-features
20
+ - run: cargo test
21
+ - run: cargo package --no-verify
22
+
23
+ version-sync:
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v7
27
+ - name: Check version consistency (Cargo.toml / py/pyproject.toml / CITATION.cff / README.md)
28
+ run: |
29
+ RUST=$(grep '^version' Cargo.toml | head -1 | grep -oP '"\K[^"]+')
30
+ PY=$(grep '^version' py/pyproject.toml | grep -oP '"\K[^"]+')
31
+ CIT=$(grep '^version:' CITATION.cff | awk '{print $2}')
32
+ README=$(grep -oP 'Experimental — v\K[0-9]+\.[0-9]+\.[0-9]+' README.md | head -1)
33
+ echo "Rust=$RUST Python=$PY Citation=$CIT README=$README"
34
+ [ "$RUST" = "$PY" ] && [ "$RUST" = "$CIT" ] && [ "$RUST" = "$README" ] || \
35
+ { echo "ERROR: version mismatch — bump Cargo.toml, py/pyproject.toml, CITATION.cff, and README.md together"; exit 1; }
36
+
37
+ python:
38
+ runs-on: ubuntu-latest
39
+ steps:
40
+ - uses: actions/checkout@v7
41
+ - uses: dtolnay/rust-toolchain@stable
42
+ - uses: Swatinem/rust-cache@v2
43
+ - uses: actions/setup-python@v6
44
+ with:
45
+ python-version: "3.11"
46
+ - name: Build and test Python bindings
47
+ run: |
48
+ python -m venv .venv
49
+ .venv/bin/pip install maturin pytest
50
+ cd py && ../.venv/bin/maturin develop --features python
51
+ ../.venv/bin/python -m pytest tests/
@@ -0,0 +1,109 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ['v*']
6
+
7
+ permissions:
8
+ contents: write # required for GitHub Release creation
9
+
10
+ jobs:
11
+ release:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v7
15
+ - uses: dtolnay/rust-toolchain@stable
16
+ - uses: Swatinem/rust-cache@v2
17
+
18
+ - name: Test
19
+ run: cargo test
20
+
21
+ - name: Publish to crates.io
22
+ env:
23
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
24
+ run: |
25
+ set +e
26
+ out=$(cargo publish 2>&1)
27
+ ec=$?
28
+ echo "$out"
29
+ [ $ec -eq 0 ] || echo "$out" | grep -q "already exists"
30
+
31
+ - name: Create GitHub Release
32
+ uses: softprops/action-gh-release@v3
33
+ with:
34
+ generate_release_notes: true
35
+
36
+ # ── Python wheels ─────────────────────────────────────────────────────────────
37
+
38
+ linux-wheels:
39
+ runs-on: ubuntu-latest
40
+ steps:
41
+ - uses: actions/checkout@v7
42
+ - uses: PyO3/maturin-action@v1
43
+ with:
44
+ working-directory: py
45
+ command: build
46
+ args: --release --out ../dist
47
+ manylinux: auto
48
+ - uses: actions/upload-artifact@v4
49
+ with:
50
+ name: linux-wheels
51
+ path: dist
52
+
53
+ macos-wheels:
54
+ runs-on: macos-latest
55
+ steps:
56
+ - uses: actions/checkout@v7
57
+ - uses: PyO3/maturin-action@v1
58
+ with:
59
+ working-directory: py
60
+ target: universal2-apple-darwin
61
+ command: build
62
+ args: --release --out ../dist
63
+ - uses: actions/upload-artifact@v4
64
+ with:
65
+ name: macos-wheels
66
+ path: dist
67
+
68
+ windows-wheels:
69
+ runs-on: windows-latest
70
+ steps:
71
+ - uses: actions/checkout@v7
72
+ - uses: PyO3/maturin-action@v1
73
+ with:
74
+ working-directory: py
75
+ command: build
76
+ args: --release --out ../dist
77
+ - uses: actions/upload-artifact@v4
78
+ with:
79
+ name: windows-wheels
80
+ path: dist
81
+
82
+ sdist:
83
+ runs-on: ubuntu-latest
84
+ steps:
85
+ - uses: actions/checkout@v7
86
+ - uses: PyO3/maturin-action@v1
87
+ with:
88
+ working-directory: py
89
+ command: sdist
90
+ args: --out ../dist
91
+ - uses: actions/upload-artifact@v4
92
+ with:
93
+ name: sdist
94
+ path: dist
95
+
96
+ publish-pypi:
97
+ needs: [linux-wheels, macos-wheels, windows-wheels, sdist]
98
+ runs-on: ubuntu-latest
99
+ environment:
100
+ name: pypi
101
+ url: https://pypi.org/p/causasv
102
+ permissions:
103
+ id-token: write # Trusted Publisher (OIDC) — no token secret needed
104
+ steps:
105
+ - uses: actions/download-artifact@v4
106
+ with:
107
+ merge-multiple: true
108
+ path: dist
109
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,35 @@
1
+ name: Security
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ pull_request:
7
+ branches: ["main"]
8
+ schedule:
9
+ - cron: "17 4 * * 1"
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ cargo-audit:
16
+ name: cargo audit
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v7
20
+ - uses: dtolnay/rust-toolchain@stable
21
+ - run: cargo install cargo-audit --locked
22
+ - run: cargo audit
23
+
24
+ pip-audit:
25
+ name: pip-audit
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - uses: actions/checkout@v7
29
+ - uses: actions/setup-python@v6
30
+ with:
31
+ python-version: "3.11"
32
+ - run: pip install pip-audit
33
+ - name: Run pip-audit
34
+ working-directory: py
35
+ run: pip-audit
@@ -0,0 +1,13 @@
1
+ /target
2
+ /py/.venv
3
+ /py/*.so
4
+ /py/*.pyd
5
+ /py/causasv/*.so
6
+ /py/causasv/*.pyd
7
+ __pycache__/
8
+ *.pyc
9
+ .pytest_cache/
10
+ dist/
11
+ *.egg-info/
12
+ .claude/
13
+ tasks/