ruptures-rs 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 (39) hide show
  1. ruptures_rs-0.1.0/.gitattributes +3 -0
  2. ruptures_rs-0.1.0/.github/workflows/ci.yml +172 -0
  3. ruptures_rs-0.1.0/.gitignore +12 -0
  4. ruptures_rs-0.1.0/CHANGELOG.md +147 -0
  5. ruptures_rs-0.1.0/Cargo.lock +322 -0
  6. ruptures_rs-0.1.0/Cargo.toml +24 -0
  7. ruptures_rs-0.1.0/LICENSE +35 -0
  8. ruptures_rs-0.1.0/PKG-INFO +428 -0
  9. ruptures_rs-0.1.0/README.md +391 -0
  10. ruptures_rs-0.1.0/bench/bench.log +32 -0
  11. ruptures_rs-0.1.0/bench/bench.py +436 -0
  12. ruptures_rs-0.1.0/bench/results.json +158 -0
  13. ruptures_rs-0.1.0/examples/penalty_path.py +100 -0
  14. ruptures_rs-0.1.0/pyproject.toml +54 -0
  15. ruptures_rs-0.1.0/python/ruptures_rs/__init__.py +180 -0
  16. ruptures_rs-0.1.0/python/ruptures_rs/_fallback.py +294 -0
  17. ruptures_rs-0.1.0/python/ruptures_rs/base.py +41 -0
  18. ruptures_rs-0.1.0/python/ruptures_rs/costs.py +323 -0
  19. ruptures_rs-0.1.0/python/ruptures_rs/crops.py +99 -0
  20. ruptures_rs-0.1.0/python/ruptures_rs/datasets.py +75 -0
  21. ruptures_rs-0.1.0/python/ruptures_rs/detection.py +333 -0
  22. ruptures_rs-0.1.0/python/ruptures_rs/exceptions.py +9 -0
  23. ruptures_rs-0.1.0/python/ruptures_rs/metrics.py +120 -0
  24. ruptures_rs-0.1.0/python/ruptures_rs/show.py +73 -0
  25. ruptures_rs-0.1.0/python/ruptures_rs/utils.py +128 -0
  26. ruptures_rs-0.1.0/python/ruptures_rs/version.py +10 -0
  27. ruptures_rs-0.1.0/src/cost.rs +1047 -0
  28. ruptures_rs-0.1.0/src/crops.rs +139 -0
  29. ruptures_rs-0.1.0/src/detect.rs +841 -0
  30. ruptures_rs-0.1.0/src/lib.rs +582 -0
  31. ruptures_rs-0.1.0/src/linalg.rs +323 -0
  32. ruptures_rs-0.1.0/src/prefix.rs +274 -0
  33. ruptures_rs-0.1.0/tests/test_crops.py +98 -0
  34. ruptures_rs-0.1.0/tests/test_equivalence.py +329 -0
  35. ruptures_rs-0.1.0/tests/test_fuzz.py +253 -0
  36. ruptures_rs-0.1.0/tests/test_install.py +136 -0
  37. ruptures_rs-0.1.0/tests/test_precision.py +281 -0
  38. ruptures_rs-0.1.0/tests/test_robustness.py +425 -0
  39. ruptures_rs-0.1.0/tests/test_ties.py +289 -0
@@ -0,0 +1,3 @@
1
+ * text=auto eol=lf
2
+ *.png binary
3
+ *.whl binary
@@ -0,0 +1,172 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ tags: ["v*"]
7
+ pull_request:
8
+ workflow_dispatch:
9
+
10
+ concurrency:
11
+ group: ${{ github.workflow }}-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ jobs:
15
+ lint:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ # Pinned, not `stable`. `-D warnings` against a rolling toolchain means
20
+ # any Rust release can fail CI on unchanged code. This repo's first run
21
+ # broke exactly that way: CI was on 1.98.1, development on 1.94.1, and
22
+ # the newer clippy rejected a `sort_by` the older one accepted. Bump
23
+ # this deliberately rather than being surprised by it.
24
+ - uses: dtolnay/rust-toolchain@1.98.1
25
+ with:
26
+ components: rustfmt, clippy
27
+ - run: cargo fmt --all -- --check
28
+ - run: cargo clippy --all-targets -- -D warnings
29
+
30
+ rust-tests:
31
+ # The Rust unit tests cover what the Python suite cannot reach directly:
32
+ # NaN-safe ordering, the rank rule, detrending, and the kernel flavours.
33
+ runs-on: ubuntu-latest
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+ - uses: dtolnay/rust-toolchain@1.98.1
37
+ - run: cargo test --release
38
+
39
+ test:
40
+ name: test ${{ matrix.os }} / py${{ matrix.python }}
41
+ runs-on: ${{ matrix.os }}
42
+ strategy:
43
+ fail-fast: false
44
+ matrix:
45
+ os: [ubuntu-latest, macos-latest, windows-latest]
46
+ # 3.14 is included deliberately: `ruptures` 1.1.9 ships no cp314 wheel,
47
+ # so it cannot be installed there without a C toolchain. One abi3-py310
48
+ # wheel covers 3.10 onward, so this package works on 3.14 anyway - and
49
+ # this matrix entry is what proves it rather than asserting it.
50
+ python: ["3.10", "3.13", "3.14"]
51
+ steps:
52
+ - uses: actions/checkout@v4
53
+ - uses: actions/setup-python@v5
54
+ with:
55
+ python-version: ${{ matrix.python }}
56
+ - uses: dtolnay/rust-toolchain@stable
57
+
58
+ - name: Build and install
59
+ shell: bash
60
+ run: |
61
+ python -m pip install --upgrade pip
62
+ pip install maturin pytest numpy
63
+ maturin build --release --out dist
64
+ pip install --no-index --find-links dist ruptures-rs
65
+
66
+ - name: Install the reference implementation
67
+ shell: bash
68
+ # Most tests are differential against `ruptures`. Where it cannot be
69
+ # installed the suite skips those and still runs everything that
70
+ # validates this package on its own - precision against exact
71
+ # arithmetic, the install shim, the API surface, the crash guards.
72
+ # A missing reference must not fail a build.
73
+ run: |
74
+ pip install scipy "ruptures>=1.1.9" || echo "::warning::reference unavailable here; differential tests will skip"
75
+
76
+ - name: Test
77
+ shell: bash
78
+ run: pytest tests/ -q -rs
79
+
80
+ sdist-install:
81
+ # The wheels are what users get; the sdist is what they fall back to on a
82
+ # platform with no wheel. Building one is not the same as installing it,
83
+ # and only installing it proves the crate compiles from the packaged
84
+ # sources rather than from the checkout.
85
+ runs-on: ubuntu-latest
86
+ steps:
87
+ - uses: actions/checkout@v4
88
+ - uses: actions/setup-python@v5
89
+ with:
90
+ python-version: "3.12"
91
+ - uses: dtolnay/rust-toolchain@stable
92
+ - uses: PyO3/maturin-action@v1
93
+ with:
94
+ command: sdist
95
+ args: --out dist
96
+ - name: Install from the sdist and import it
97
+ run: |
98
+ python -m pip install --upgrade pip
99
+ pip install numpy
100
+ pip install --no-binary ruptures-rs dist/*.tar.gz
101
+ cd /
102
+ python -c "import ruptures_rs as rpt; s, _ = rpt.pw_constant(300, 1, 3, noise_std=2, seed=1); print(rpt.Dynp(model='l2').fit(s).predict(3))"
103
+
104
+ wheels:
105
+ name: wheels ${{ matrix.platform.os }} ${{ matrix.platform.target }} ${{ matrix.platform.manylinux }}
106
+ # Wheels for every platform are the whole point of a drop-in replacement:
107
+ # if `pip install` has to compile, trying it is no longer free.
108
+ runs-on: ${{ matrix.platform.os }}
109
+ strategy:
110
+ fail-fast: false
111
+ matrix:
112
+ platform:
113
+ - { os: ubuntu-latest, target: x86_64, manylinux: auto }
114
+ - { os: ubuntu-latest, target: aarch64, manylinux: auto }
115
+ # musl wheels matter more than their share of users suggests: Alpine
116
+ # is the default base image for a lot of containers, and without one
117
+ # `pip install` there falls back to compiling the crate.
118
+ - { os: ubuntu-latest, target: x86_64, manylinux: musllinux_1_2 }
119
+ - { os: ubuntu-latest, target: aarch64, manylinux: musllinux_1_2 }
120
+ - { os: windows-latest, target: x64, manylinux: auto }
121
+ - { os: macos-latest, target: x86_64, manylinux: auto }
122
+ - { os: macos-latest, target: aarch64, manylinux: auto }
123
+ steps:
124
+ - uses: actions/checkout@v4
125
+ - uses: actions/setup-python@v5
126
+ with:
127
+ python-version: "3.12"
128
+ - uses: PyO3/maturin-action@v1
129
+ with:
130
+ target: ${{ matrix.platform.target }}
131
+ # abi3-py310: one wheel per platform covers 3.10 through 3.14+
132
+ args: --release --out dist
133
+ manylinux: ${{ matrix.platform.manylinux }}
134
+ - uses: actions/upload-artifact@v4
135
+ with:
136
+ name: wheels-${{ matrix.platform.os }}-${{ matrix.platform.target }}-${{ matrix.platform.manylinux }}
137
+ path: dist
138
+
139
+ sdist:
140
+ runs-on: ubuntu-latest
141
+ steps:
142
+ - uses: actions/checkout@v4
143
+ - uses: PyO3/maturin-action@v1
144
+ with:
145
+ command: sdist
146
+ args: --out dist
147
+ - uses: actions/upload-artifact@v4
148
+ with:
149
+ name: sdist
150
+ path: dist
151
+
152
+ release:
153
+ if: startsWith(github.ref, 'refs/tags/v')
154
+ needs: [lint, rust-tests, test, sdist-install, wheels, sdist]
155
+ runs-on: ubuntu-latest
156
+ # Trusted publishing: PyPI mints a short-lived token from this workflow's
157
+ # OIDC identity, so there is no API token to store or leak. The identity
158
+ # PyPI checks is (repository, workflow file, environment), and all three
159
+ # have to match what is registered there — including this environment name.
160
+ environment: release
161
+ permissions:
162
+ id-token: write
163
+ steps:
164
+ - uses: actions/download-artifact@v4
165
+ with:
166
+ path: dist
167
+ merge-multiple: true
168
+ # `pypa/gh-action-pypi-publish` is what implements the OIDC exchange.
169
+ # `maturin upload` wants a token and does not do it.
170
+ - uses: pypa/gh-action-pypi-publish@release/v1
171
+ with:
172
+ skip-existing: true
@@ -0,0 +1,12 @@
1
+ target/
2
+ __pycache__/
3
+ *.pyc
4
+ *.so
5
+ *.pyd
6
+ # MSVC debug symbols, dropped next to the extension by `maturin develop`
7
+ *.pdb
8
+ .venv/
9
+ dist/
10
+ *.egg-info/
11
+ .pytest_cache/
12
+ # bench results are committed as provenance for the README numbers
@@ -0,0 +1,147 @@
1
+ # Changelog
2
+
3
+ This project follows [Semantic Versioning](https://semver.org/). Dates are
4
+ ISO 8601.
5
+
6
+ ## 0.1.0 — 2026-09-06
7
+
8
+ First public release: a drop-in reimplementation of `ruptures` 1.1.9 in Rust,
9
+ with the same classes, arguments and breakpoints, plus `Crops`, which the
10
+ reference does not have.
11
+
12
+ Everything below is development history rather than news to a new user. It is
13
+ recorded because the defects were real, several of them were the kind that a
14
+ test suite passing 759 cases still did not see, and someone comparing this
15
+ package to the reference deserves to know what was found and what was decided.
16
+
17
+ ### Fixed — crashes
18
+
19
+ Every one of these took the interpreter with it rather than raising something a
20
+ caller could catch. A Rust panic crosses `pyo3` as `PanicException`, which
21
+ inherits from `BaseException`, so `except Exception` does not see it.
22
+
23
+ - A `NaN` anywhere in the signal panicked `l1` (an `unwrap` on the median's
24
+ comparator), `rank` (a `sort_by` that stopped being a total order) and `rbf`
25
+ (the same median, on pairwise distances). All ordering now goes through
26
+ `f64::total_cmp`, and `NaN` propagates into the cost the way it does in
27
+ `ruptures`.
28
+ - `cost.sum_of_costs([60, 500])` on a 120-sample signal indexed off the end of a
29
+ prefix array. Segment bounds are validated and raise `ValueError`.
30
+ - `jump=0` panicked inside `step_by`. It is refused at construction.
31
+ - A wide signal aborted the process: the covariance-shaped costs (`normal`,
32
+ `mahalanobis`, `linear`, `ar`) allocate `(n+1) * d^2` doubles with no guard,
33
+ and a failed allocation in Rust aborts rather than raising. A 50,000 x 400
34
+ signal asked for 60 GiB. There is now a budget check with an actionable
35
+ message, applied before NumPy builds a covariance of its own.
36
+
37
+ ### Fixed — silently wrong answers
38
+
39
+ - `Dynp` returned *fewer* breakpoints than requested when no admissible
40
+ partition existed, instead of raising. It now raises, as `ruptures` does.
41
+ - A cost clamped at zero — needed because the prefix-sum forms can land a few
42
+ ulp below zero on a constant segment — turned `NaN` into `0.0` through
43
+ `f64::max`. A zero cost is the most attractive segment there is, so corrupt
44
+ data pulled breakpoints towards itself.
45
+ - `CostNormal(add_small_diag=0)` and `CostAR(order=-1)` silently ran with the
46
+ default, because a failed parameter extraction fell back instead of
47
+ propagating. `add_small_diag` now follows Python truthiness, matching
48
+ `ruptures`; a negative `order` is refused.
49
+ - `linear` and `ar` decided rank by whether a Cholesky succeeded, so a merely
50
+ ill-conditioned design reported a residual of `0.0` where NumPy returns a real
51
+ one. Rank is now decided from the eigenvalues of the normal-equations matrix.
52
+ - `Window` scored half-windows narrower than the cost's own `min_size` —
53
+ computing a median of one point — where `ruptures` raises `NotEnoughPoints`.
54
+
55
+ ### Fixed — agreement with `ruptures`
56
+
57
+ - `KernelCPD` was routed through `ruptures`' *Python* cost classes, which are
58
+ not what its C extension computes. The C cosine kernel has a unit diagonal
59
+ where `scipy`'s `squareform` leaves a zero one — worth exactly one unit of
60
+ penalty per segment, so `predict(pen=p)` was solving the problem for `p - 1` —
61
+ and its Gaussian exponent is clipped in single precision. Its penalised search
62
+ also folds the penalty in and prunes differently from the Python `Pelt`. All
63
+ three are now reproduced, and `KernelCPD` agrees across 360 differential cases
64
+ where it previously disagreed on cosine penalties.
65
+ - `Pelt` accumulated `(total + cost) + pen`; summing a `ruptures` partition dict
66
+ associates as `total + (cost + pen)`. The difference is one ulp, and it moved
67
+ breakpoints on signals with exact ties.
68
+ - The default Mahalanobis metric was inverted with a Cholesky, which disagrees
69
+ with `numpy.linalg.inv` about which covariances are singular — refusing
70
+ signals the reference segments, and raising a different exception when it did
71
+ refuse. It is now computed in NumPy, so `LinAlgError` matches too.
72
+ - `cosine` returned a finite cost for zero-norm rows where `scipy` returns
73
+ `NaN`.
74
+ - `Dynp` discarded partitions whose cost was `-inf`, which `ruptures` admits and
75
+ frequently prefers — reachable with `normal` and `add_small_diag=False`.
76
+
77
+ ### Fixed — accuracy
78
+
79
+ - `clinear` lost most of its significant digits on exactly the signals it is
80
+ for. Centring removes an offset but not a trend, so on a 20,000-point ramp the
81
+ relative error was 6e-3 against the reference's 1e-11. The cost is invariant
82
+ under subtracting *any* affine function of the sample index, so the signal is
83
+ now detrended by its global least-squares line first: 1e-11, on par with the
84
+ reference.
85
+ - `ar` was solved on raw values; the intercept column makes the residual
86
+ invariant under a shift, so the signal is now centred first. Relative error at
87
+ an offset of 1e5 went from 1.7e-2 to 2.8e-10.
88
+ - `linear` now removes a global least-squares fit from the response and
89
+ accumulates its design centred. Relative error at an offset of 1e5 went from
90
+ 7.4e-3 to 3.8e-5.
91
+ - A Jacobi eigendecomposition tested convergence against an absolute `1e-300`,
92
+ which a Gram matrix of any realistic scale never reaches, so every call ran all
93
+ one hundred sweeps. The threshold is now relative.
94
+
95
+ ### Added
96
+
97
+ - `metrics.hamming`, `metrics.sanity_check`, `metrics.BadPartitions`,
98
+ `utils.Bnode` and `utils.from_path_matrix_to_bkps_list`, completing the
99
+ `ruptures` surface.
100
+ - `Window` supports `custom_cost`, which previously raised `NotImplementedError`
101
+ in contradiction of the documented fallback.
102
+ - `cost_factory` discovers user-defined `BaseCost` subclasses by their `model`
103
+ name, so `Pelt(model="my_cost")` works as it does in `ruptures`.
104
+ - `install()` aliases leaf modules, so `from ruptures.costs.costl2 import CostL2`
105
+ and `from ruptures.detection.pelt import Pelt` resolve.
106
+ - `KernelCPD.segmentations_dict` is filled for every `k` up to the requested
107
+ number, from a single dynamic program, as the reference's path matrix does.
108
+ - A `RuntimeWarning` when the default Mahalanobis metric comes from a covariance
109
+ that is numerically singular, where every cost computed from it is dominated
110
+ by rounding error. `ruptures` says nothing in this case.
111
+ - `CostMl` accepts a nested list or an integer array as `metric`; `jump` and
112
+ `min_size` accept whole-valued floats. All three work in `ruptures`.
113
+ - `CostLinear` accepts a single-column signal, where NumPy reports rank 0 of 0
114
+ and the residual is the whole of `y^T y`.
115
+
116
+ ### Changed
117
+
118
+ - `hausdorff` and `meantime` return floats, as `ruptures` does through
119
+ `scipy.spatial.distance.cdist`. `hausdorff` previously returned an integer.
120
+ - Metric validation uses explicit exceptions rather than `assert`, which
121
+ `python -O` strips, and no longer requires sorted breakpoints — `ruptures`
122
+ does not.
123
+ - Segment bounds outside the signal raise instead of being silently clamped by
124
+ NumPy slicing.
125
+ - `CostRank.error` returns a float rather than the 1x1 array `ruptures` returns
126
+ from an uncollapsed matrix product.
127
+
128
+ ### Known differences
129
+
130
+ Recorded in the README under "Where the answers differ". In short: signals with
131
+ exactly repeated values admit many equally-optimal segmentations, and `Window`
132
+ can pick a different number of peaks on them; `linear` on a design whose
133
+ condition number exceeds about 1e8 is reported as rank deficient; the default
134
+ Mahalanobis metric is noise once the covariance is near-singular, which now
135
+ warns; and `normal` with `add_small_diag=False` on a segment that is constant to
136
+ machine precision is meaningless in both libraries.
137
+
138
+ ### Testing
139
+
140
+ 1,392 tests, up from 759, with 800 randomised differential fuzz cases up from
141
+ 440. New: fuzz coverage for `Window`, `epsilon` stopping, `linear`/`ar`/`cosine`
142
+ and `KernelCPD` in both of its modes; robustness tests for every crash above;
143
+ and tie-behaviour tests that assert the exact detectors never return a worse
144
+ segmentation than the reference on tied input, rather than asserting a
145
+ coincidence. `cargo test` runs 24 Rust unit tests in CI, and a new job installs
146
+ the built sdist and imports it, so a release cannot ship sources that do not
147
+ compile.
@@ -0,0 +1,322 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 3
4
+
5
+ [[package]]
6
+ name = "autocfg"
7
+ version = "1.5.1"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
10
+
11
+ [[package]]
12
+ name = "cfg-if"
13
+ version = "1.0.4"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
16
+
17
+ [[package]]
18
+ name = "crossbeam-deque"
19
+ version = "0.8.8"
20
+ source = "registry+https://github.com/rust-lang/crates.io-index"
21
+ checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a"
22
+ dependencies = [
23
+ "crossbeam-epoch",
24
+ "crossbeam-utils",
25
+ ]
26
+
27
+ [[package]]
28
+ name = "crossbeam-epoch"
29
+ version = "0.9.21"
30
+ source = "registry+https://github.com/rust-lang/crates.io-index"
31
+ checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d"
32
+ dependencies = [
33
+ "crossbeam-utils",
34
+ ]
35
+
36
+ [[package]]
37
+ name = "crossbeam-utils"
38
+ version = "0.8.23"
39
+ source = "registry+https://github.com/rust-lang/crates.io-index"
40
+ checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
41
+
42
+ [[package]]
43
+ name = "either"
44
+ version = "1.18.0"
45
+ source = "registry+https://github.com/rust-lang/crates.io-index"
46
+ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"
47
+
48
+ [[package]]
49
+ name = "heck"
50
+ version = "0.5.0"
51
+ source = "registry+https://github.com/rust-lang/crates.io-index"
52
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
53
+
54
+ [[package]]
55
+ name = "indoc"
56
+ version = "2.0.7"
57
+ source = "registry+https://github.com/rust-lang/crates.io-index"
58
+ checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
59
+ dependencies = [
60
+ "rustversion",
61
+ ]
62
+
63
+ [[package]]
64
+ name = "libc"
65
+ version = "0.2.189"
66
+ source = "registry+https://github.com/rust-lang/crates.io-index"
67
+ checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
68
+
69
+ [[package]]
70
+ name = "matrixmultiply"
71
+ version = "0.3.11"
72
+ source = "registry+https://github.com/rust-lang/crates.io-index"
73
+ checksum = "3f607c237553f086e7043417a51df26b2eb899d3caff94e6a67592ff992fedc7"
74
+ dependencies = [
75
+ "autocfg",
76
+ "rawpointer",
77
+ ]
78
+
79
+ [[package]]
80
+ name = "memoffset"
81
+ version = "0.9.1"
82
+ source = "registry+https://github.com/rust-lang/crates.io-index"
83
+ checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
84
+ dependencies = [
85
+ "autocfg",
86
+ ]
87
+
88
+ [[package]]
89
+ name = "ndarray"
90
+ version = "0.16.1"
91
+ source = "registry+https://github.com/rust-lang/crates.io-index"
92
+ checksum = "882ed72dce9365842bf196bdeedf5055305f11fc8c03dee7bb0194a6cad34841"
93
+ dependencies = [
94
+ "matrixmultiply",
95
+ "num-complex",
96
+ "num-integer",
97
+ "num-traits",
98
+ "portable-atomic",
99
+ "portable-atomic-util",
100
+ "rawpointer",
101
+ ]
102
+
103
+ [[package]]
104
+ name = "num-complex"
105
+ version = "0.4.6"
106
+ source = "registry+https://github.com/rust-lang/crates.io-index"
107
+ checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
108
+ dependencies = [
109
+ "num-traits",
110
+ ]
111
+
112
+ [[package]]
113
+ name = "num-integer"
114
+ version = "0.1.47"
115
+ source = "registry+https://github.com/rust-lang/crates.io-index"
116
+ checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b"
117
+ dependencies = [
118
+ "num-traits",
119
+ ]
120
+
121
+ [[package]]
122
+ name = "num-traits"
123
+ version = "0.2.19"
124
+ source = "registry+https://github.com/rust-lang/crates.io-index"
125
+ checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
126
+ dependencies = [
127
+ "autocfg",
128
+ ]
129
+
130
+ [[package]]
131
+ name = "numpy"
132
+ version = "0.23.0"
133
+ source = "registry+https://github.com/rust-lang/crates.io-index"
134
+ checksum = "b94caae805f998a07d33af06e6a3891e38556051b8045c615470a71590e13e78"
135
+ dependencies = [
136
+ "libc",
137
+ "ndarray",
138
+ "num-complex",
139
+ "num-integer",
140
+ "num-traits",
141
+ "pyo3",
142
+ "rustc-hash",
143
+ ]
144
+
145
+ [[package]]
146
+ name = "once_cell"
147
+ version = "1.21.4"
148
+ source = "registry+https://github.com/rust-lang/crates.io-index"
149
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
150
+
151
+ [[package]]
152
+ name = "portable-atomic"
153
+ version = "1.15.0"
154
+ source = "registry+https://github.com/rust-lang/crates.io-index"
155
+ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
156
+
157
+ [[package]]
158
+ name = "portable-atomic-util"
159
+ version = "0.2.8"
160
+ source = "registry+https://github.com/rust-lang/crates.io-index"
161
+ checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715"
162
+ dependencies = [
163
+ "portable-atomic",
164
+ ]
165
+
166
+ [[package]]
167
+ name = "proc-macro2"
168
+ version = "1.0.107"
169
+ source = "registry+https://github.com/rust-lang/crates.io-index"
170
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
171
+ dependencies = [
172
+ "unicode-ident",
173
+ ]
174
+
175
+ [[package]]
176
+ name = "pyo3"
177
+ version = "0.23.5"
178
+ source = "registry+https://github.com/rust-lang/crates.io-index"
179
+ checksum = "7778bffd85cf38175ac1f545509665d0b9b92a198ca7941f131f85f7a4f9a872"
180
+ dependencies = [
181
+ "cfg-if",
182
+ "indoc",
183
+ "libc",
184
+ "memoffset",
185
+ "once_cell",
186
+ "portable-atomic",
187
+ "pyo3-build-config",
188
+ "pyo3-ffi",
189
+ "pyo3-macros",
190
+ "unindent",
191
+ ]
192
+
193
+ [[package]]
194
+ name = "pyo3-build-config"
195
+ version = "0.23.5"
196
+ source = "registry+https://github.com/rust-lang/crates.io-index"
197
+ checksum = "94f6cbe86ef3bf18998d9df6e0f3fc1050a8c5efa409bf712e661a4366e010fb"
198
+ dependencies = [
199
+ "once_cell",
200
+ "target-lexicon",
201
+ ]
202
+
203
+ [[package]]
204
+ name = "pyo3-ffi"
205
+ version = "0.23.5"
206
+ source = "registry+https://github.com/rust-lang/crates.io-index"
207
+ checksum = "e9f1b4c431c0bb1c8fb0a338709859eed0d030ff6daa34368d3b152a63dfdd8d"
208
+ dependencies = [
209
+ "libc",
210
+ "pyo3-build-config",
211
+ ]
212
+
213
+ [[package]]
214
+ name = "pyo3-macros"
215
+ version = "0.23.5"
216
+ source = "registry+https://github.com/rust-lang/crates.io-index"
217
+ checksum = "fbc2201328f63c4710f68abdf653c89d8dbc2858b88c5d88b0ff38a75288a9da"
218
+ dependencies = [
219
+ "proc-macro2",
220
+ "pyo3-macros-backend",
221
+ "quote",
222
+ "syn",
223
+ ]
224
+
225
+ [[package]]
226
+ name = "pyo3-macros-backend"
227
+ version = "0.23.5"
228
+ source = "registry+https://github.com/rust-lang/crates.io-index"
229
+ checksum = "fca6726ad0f3da9c9de093d6f116a93c1a38e417ed73bf138472cf4064f72028"
230
+ dependencies = [
231
+ "heck",
232
+ "proc-macro2",
233
+ "pyo3-build-config",
234
+ "quote",
235
+ "syn",
236
+ ]
237
+
238
+ [[package]]
239
+ name = "quote"
240
+ version = "1.0.47"
241
+ source = "registry+https://github.com/rust-lang/crates.io-index"
242
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
243
+ dependencies = [
244
+ "proc-macro2",
245
+ ]
246
+
247
+ [[package]]
248
+ name = "rawpointer"
249
+ version = "0.2.1"
250
+ source = "registry+https://github.com/rust-lang/crates.io-index"
251
+ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
252
+
253
+ [[package]]
254
+ name = "rayon"
255
+ version = "1.12.0"
256
+ source = "registry+https://github.com/rust-lang/crates.io-index"
257
+ checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
258
+ dependencies = [
259
+ "either",
260
+ "rayon-core",
261
+ ]
262
+
263
+ [[package]]
264
+ name = "rayon-core"
265
+ version = "1.13.0"
266
+ source = "registry+https://github.com/rust-lang/crates.io-index"
267
+ checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
268
+ dependencies = [
269
+ "crossbeam-deque",
270
+ "crossbeam-utils",
271
+ ]
272
+
273
+ [[package]]
274
+ name = "ruptures-rs"
275
+ version = "0.1.0"
276
+ dependencies = [
277
+ "ndarray",
278
+ "numpy",
279
+ "pyo3",
280
+ "rayon",
281
+ ]
282
+
283
+ [[package]]
284
+ name = "rustc-hash"
285
+ version = "2.1.3"
286
+ source = "registry+https://github.com/rust-lang/crates.io-index"
287
+ checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
288
+
289
+ [[package]]
290
+ name = "rustversion"
291
+ version = "1.0.23"
292
+ source = "registry+https://github.com/rust-lang/crates.io-index"
293
+ checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
294
+
295
+ [[package]]
296
+ name = "syn"
297
+ version = "2.0.119"
298
+ source = "registry+https://github.com/rust-lang/crates.io-index"
299
+ checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
300
+ dependencies = [
301
+ "proc-macro2",
302
+ "quote",
303
+ "unicode-ident",
304
+ ]
305
+
306
+ [[package]]
307
+ name = "target-lexicon"
308
+ version = "0.12.16"
309
+ source = "registry+https://github.com/rust-lang/crates.io-index"
310
+ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
311
+
312
+ [[package]]
313
+ name = "unicode-ident"
314
+ version = "1.0.24"
315
+ source = "registry+https://github.com/rust-lang/crates.io-index"
316
+ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
317
+
318
+ [[package]]
319
+ name = "unindent"
320
+ version = "0.2.4"
321
+ source = "registry+https://github.com/rust-lang/crates.io-index"
322
+ checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
@@ -0,0 +1,24 @@
1
+ [package]
2
+ name = "ruptures-rs"
3
+ version = "0.1.0"
4
+ edition = "2021"
5
+ rust-version = "1.74"
6
+ description = "Fast, drop-in change point detection for Python, powered by Rust"
7
+ license = "BSD-2-Clause"
8
+ repository = "https://github.com/Fatin-Ishraq/ruptures-rs"
9
+ readme = "README.md"
10
+
11
+ [lib]
12
+ name = "_ruptures_rs"
13
+ crate-type = ["cdylib", "rlib"]
14
+
15
+ [dependencies]
16
+ pyo3 = { version = "0.23", features = ["extension-module", "abi3-py310"] }
17
+ numpy = "0.23"
18
+ ndarray = "0.16"
19
+ rayon = "1.10"
20
+
21
+ [profile.release]
22
+ opt-level = 3
23
+ lto = "fat"
24
+ codegen-units = 1