betulars 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 (44) hide show
  1. betulars-0.1.0/.github/workflows/build.yml +192 -0
  2. betulars-0.1.0/.gitignore +29 -0
  3. betulars-0.1.0/CHANGELOG.md +4 -0
  4. betulars-0.1.0/Cargo.lock +1120 -0
  5. betulars-0.1.0/Cargo.toml +87 -0
  6. betulars-0.1.0/LICENSE-APACHE +201 -0
  7. betulars-0.1.0/LICENSE-MIT +21 -0
  8. betulars-0.1.0/PKG-INFO +291 -0
  9. betulars-0.1.0/README.md +259 -0
  10. betulars-0.1.0/benches/baseline_bench.rs +303 -0
  11. betulars-0.1.0/benches/cf_tree_insert.rs +39 -0
  12. betulars-0.1.0/benches/cluster_feature.rs +213 -0
  13. betulars-0.1.0/benches/distance.rs +167 -0
  14. betulars-0.1.0/betulars/__init__.py +9 -0
  15. betulars-0.1.0/betulars/_betulars.pyi +98 -0
  16. betulars-0.1.0/pyproject.toml +46 -0
  17. betulars-0.1.0/rustfmt.toml +1 -0
  18. betulars-0.1.0/src/betula.rs +58 -0
  19. betulars-0.1.0/src/bin/bench.rs +76 -0
  20. betulars-0.1.0/src/bin/betula.rs +310 -0
  21. betulars-0.1.0/src/cf_tree/insert.rs +255 -0
  22. betulars-0.1.0/src/cf_tree/mod.rs +267 -0
  23. betulars-0.1.0/src/cf_tree/rebuild.rs +215 -0
  24. betulars-0.1.0/src/cf_tree/regression.rs +343 -0
  25. betulars-0.1.0/src/cf_tree/split.rs +533 -0
  26. betulars-0.1.0/src/cluster_feature/mod.rs +54 -0
  27. betulars-0.1.0/src/cluster_feature/vii.rs +500 -0
  28. betulars-0.1.0/src/cluster_feature/vvi.rs +432 -0
  29. betulars-0.1.0/src/cluster_feature/vvv.rs +773 -0
  30. betulars-0.1.0/src/distance/centroid.rs +146 -0
  31. betulars-0.1.0/src/distance/intercluster.rs +467 -0
  32. betulars-0.1.0/src/distance/mod.rs +48 -0
  33. betulars-0.1.0/src/distance/radius.rs +337 -0
  34. betulars-0.1.0/src/distance/regression.rs +175 -0
  35. betulars-0.1.0/src/distance/variance.rs +318 -0
  36. betulars-0.1.0/src/distance/vector_distance.rs +163 -0
  37. betulars-0.1.0/src/lib.rs +79 -0
  38. betulars-0.1.0/src/python/betula.rs +151 -0
  39. betulars-0.1.0/src/python/cf_tree.rs +250 -0
  40. betulars-0.1.0/src/python/cluster_feature.rs +81 -0
  41. betulars-0.1.0/src/python/mod.rs +21 -0
  42. betulars-0.1.0/src/python/types.rs +52 -0
  43. betulars-0.1.0/src/types.rs +49 -0
  44. betulars-0.1.0/src/utils.rs +67 -0
@@ -0,0 +1,192 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ tags:
7
+ - "v*" # Triggers the workflow when a version tag is pushed
8
+ pull_request:
9
+ branches: ["main"]
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ env:
15
+ CARGO_TERM_COLOR: always
16
+
17
+ jobs:
18
+ test:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v6
22
+ - name: Install Rust
23
+ uses: dtolnay/rust-toolchain@stable
24
+ with:
25
+ components: clippy, rustfmt
26
+ - name: Format check
27
+ run: cargo fmt --check
28
+ - name: Clippy
29
+ run: cargo clippy -- -D warnings
30
+ - name: Run tests
31
+ run: cargo test --verbose
32
+
33
+ crates:
34
+ name: Publish Crate to crates.io
35
+ runs-on: ubuntu-latest
36
+ needs: test
37
+
38
+ if: startsWith(github.ref, 'refs/tags/v')
39
+
40
+ permissions:
41
+ id-token: write
42
+ contents: read
43
+
44
+ steps:
45
+ - name: Checkout Source Code
46
+ uses: actions/checkout@v6
47
+
48
+ - name: Install Rust Toolchain
49
+ uses: dtolnay/rust-toolchain@stable
50
+
51
+ - name: Authenticate with crates.io (OIDC)
52
+ id: auth
53
+ uses: rust-lang/crates-io-auth-action@v1
54
+
55
+ - name: Run cargo publish
56
+ run: cargo publish
57
+ env:
58
+ CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
59
+
60
+ pypi:
61
+ name: Build Wheels (${{ matrix.name }})
62
+ runs-on: ${{ matrix.os }}
63
+ needs: test
64
+
65
+ if: startsWith(github.ref, 'refs/tags/v')
66
+
67
+ strategy:
68
+ fail-fast: false
69
+ matrix:
70
+ include:
71
+ - name: linux-x86_64
72
+ os: ubuntu-latest
73
+ cibw_archs: x86_64
74
+ cibw_environment_macos: ""
75
+ - name: linux-aarch64
76
+ os: ubuntu-24.04-arm
77
+ cibw_archs: aarch64
78
+ cibw_environment_macos: ""
79
+ - name: windows-amd64
80
+ os: windows-latest
81
+ cibw_archs: AMD64
82
+ cibw_environment_macos: ""
83
+ - name: macos-arm64
84
+ os: macos-14
85
+ cibw_archs: arm64
86
+ cibw_environment_macos: MACOSX_DEPLOYMENT_TARGET=11.0
87
+
88
+ permissions:
89
+ id-token: write
90
+ contents: read
91
+
92
+ steps:
93
+ - name: Checkout Source Code
94
+ uses: actions/checkout@v6
95
+
96
+ - name: Install Rust
97
+ uses: dtolnay/rust-toolchain@stable
98
+
99
+ - name: Set up Python
100
+ uses: actions/setup-python@v6
101
+ with:
102
+ python-version: "3.12"
103
+
104
+ - name: Install cibuildwheel
105
+ run: python -m pip install cibuildwheel==4.1.0
106
+
107
+ - name: Build Wheels
108
+ run: python -m cibuildwheel --output-dir wheelhouse
109
+ env:
110
+ CIBW_BUILD: "cp39-* cp314t-*"
111
+ CIBW_SKIP: "*-musllinux_*"
112
+ CIBW_ARCHS: ${{ matrix.cibw_archs }}
113
+ CIBW_BEFORE_ALL_LINUX: curl -sSf https://sh.rustup.rs | sh -s -- -y
114
+ CIBW_ENVIRONMENT_LINUX: "PATH=$HOME/.cargo/bin:$PATH"
115
+ CIBW_ENVIRONMENT_MACOS: ${{ matrix.cibw_environment_macos }}
116
+ CIBW_TEST_REQUIRES: numpy
117
+ CIBW_TEST_COMMAND: 'python -c "import betulars; print(betulars.__version__)"'
118
+
119
+ - name: Upload Wheels as Artifacts
120
+ uses: actions/upload-artifact@v4
121
+ with:
122
+ name: wheels-${{ matrix.name }}
123
+ path: wheelhouse/*.whl
124
+ retention-days: 1
125
+
126
+ sdist:
127
+ name: Build sdist
128
+ runs-on: ubuntu-latest
129
+ needs: test
130
+
131
+ if: startsWith(github.ref, 'refs/tags/v')
132
+
133
+ steps:
134
+ - name: Checkout Source Code
135
+ uses: actions/checkout@v6
136
+
137
+ - name: Set up Python
138
+ uses: actions/setup-python@v6
139
+ with:
140
+ python-version: "3.12"
141
+
142
+ - name: Install maturin
143
+ run: python -m pip install maturin
144
+
145
+ - name: Build source distribution
146
+ run: python -m maturin sdist --out dist
147
+
148
+ - name: Upload sdist as Artifact
149
+ uses: actions/upload-artifact@v4
150
+ with:
151
+ name: sdist
152
+ path: dist/*.tar.gz
153
+ retention-days: 1
154
+
155
+ pypi-publish:
156
+ name: Upload to PyPI
157
+ runs-on: ubuntu-latest
158
+ needs: [pypi, sdist]
159
+ environment: pypi
160
+
161
+ if: startsWith(github.ref, 'refs/tags/v')
162
+
163
+ permissions:
164
+ id-token: write
165
+ contents: read
166
+
167
+ steps:
168
+ - name: Download all wheel artifacts
169
+ uses: actions/download-artifact@v4
170
+ with:
171
+ pattern: wheels-*
172
+ path: dist/
173
+ merge-multiple: true
174
+
175
+ - name: Download sdist artifact
176
+ uses: actions/download-artifact@v4
177
+ with:
178
+ name: sdist
179
+ path: dist/
180
+
181
+ - name: Set up Python
182
+ uses: actions/setup-python@v6
183
+ with:
184
+ python-version: "3.12"
185
+
186
+ - name: Validate distributions
187
+ run: |
188
+ python -m pip install twine
189
+ python -m twine check dist/*
190
+
191
+ - name: Publish to PyPI
192
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,29 @@
1
+ # Build artifacts
2
+ target/
3
+
4
+ # Python bytecode
5
+ __pycache__/
6
+ **/__pycache__/
7
+ *.pyc
8
+
9
+ # Backup files generated by rustfmt
10
+ **/*.rs.bk
11
+
12
+ # MSVC Windows debug symbols
13
+ *.pdb
14
+
15
+ # cargo-mutants output
16
+ **/mutants.out*/
17
+
18
+ # Local data and comparison artifacts (not part of the source repo)
19
+ data/
20
+ misc/
21
+
22
+ # Virtual environment
23
+ .venv/
24
+
25
+ # Built extension modules in source tree
26
+ betulars/*.so
27
+
28
+ # OS files
29
+ .DS_Store
@@ -0,0 +1,4 @@
1
+ # Changelog
2
+
3
+ ## V0.1.0 (2026-06-16)
4
+ - initial release