adaptif 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 (47) hide show
  1. adaptif-0.1.0/CONTRIBUTING.md +161 -0
  2. adaptif-0.1.0/Cargo.lock +363 -0
  3. adaptif-0.1.0/Cargo.toml +89 -0
  4. adaptif-0.1.0/LICENSE-APACHE +201 -0
  5. adaptif-0.1.0/LICENSE-MIT +20 -0
  6. adaptif-0.1.0/PKG-INFO +160 -0
  7. adaptif-0.1.0/README.md +129 -0
  8. adaptif-0.1.0/examples/README.md +10 -0
  9. adaptif-0.1.0/examples/custom_algorithm.rs +91 -0
  10. adaptif-0.1.0/examples/offline_adaptation.rs +68 -0
  11. adaptif-0.1.0/examples/on-the-fly_adaptation.rs +64 -0
  12. adaptif-0.1.0/examples/python_bindings.ipynb +203 -0
  13. adaptif-0.1.0/katex-header.html +16 -0
  14. adaptif-0.1.0/pyproject.toml +98 -0
  15. adaptif-0.1.0/python/adaptif/__init__.py +7 -0
  16. adaptif-0.1.0/python/adaptif/adaptif.pyi +214 -0
  17. adaptif-0.1.0/python/adaptif/py.typed +0 -0
  18. adaptif-0.1.0/src/algorithms/lms.rs +128 -0
  19. adaptif-0.1.0/src/algorithms/mod.rs +11 -0
  20. adaptif-0.1.0/src/algorithms/nlms.rs +165 -0
  21. adaptif-0.1.0/src/algorithms/rls.rs +390 -0
  22. adaptif-0.1.0/src/algorithms/traits.rs +50 -0
  23. adaptif-0.1.0/src/error.rs +60 -0
  24. adaptif-0.1.0/src/filters/filter_base.rs +700 -0
  25. adaptif-0.1.0/src/filters/lms.rs +215 -0
  26. adaptif-0.1.0/src/filters/mod.rs +11 -0
  27. adaptif-0.1.0/src/filters/nlms.rs +205 -0
  28. adaptif-0.1.0/src/filters/rls.rs +225 -0
  29. adaptif-0.1.0/src/lib.rs +143 -0
  30. adaptif-0.1.0/src/python/bindings.rs +204 -0
  31. adaptif-0.1.0/src/python/macros.rs +109 -0
  32. adaptif-0.1.0/src/python/mod.rs +2 -0
  33. adaptif-0.1.0/src/test_utils.rs +33 -0
  34. adaptif-0.1.0/src/types/block_size.rs +46 -0
  35. adaptif-0.1.0/src/types/buffers/error.rs +46 -0
  36. adaptif-0.1.0/src/types/buffers/mod.rs +10 -0
  37. adaptif-0.1.0/src/types/buffers/noise.rs +194 -0
  38. adaptif-0.1.0/src/types/buffers/sample_buffer.rs +144 -0
  39. adaptif-0.1.0/src/types/filter_weights.rs +69 -0
  40. adaptif-0.1.0/src/types/float.rs +13 -0
  41. adaptif-0.1.0/src/types/mod.rs +20 -0
  42. adaptif-0.1.0/src/types/noise_estimate.rs +13 -0
  43. adaptif-0.1.0/src/types/signals/input.rs +75 -0
  44. adaptif-0.1.0/src/types/signals/mod.rs +12 -0
  45. adaptif-0.1.0/src/types/signals/noise.rs +73 -0
  46. adaptif-0.1.0/src/types/signals/output.rs +37 -0
  47. adaptif-0.1.0/src/types/window_size.rs +45 -0
@@ -0,0 +1,161 @@
1
+ # How to contribute
2
+
3
+ ### READ BELOW
4
+
5
+ ---
6
+
7
+ #### If a PR is submitted with no issue attached and a green light on working on a PR, it will be generally closed. Undisclosed AI PRs will be **closed** automatically
8
+
9
+ #### **Overall, submit an issue instead.**
10
+
11
+ ---
12
+
13
+ ## General Information
14
+
15
+ ### Makefile
16
+
17
+ Project setup and common development processes are all codified using Make.
18
+ Please read through the project's Makefile for more details on the steps described below.
19
+
20
+ #### Quick Reference
21
+ Environment setup:
22
+ - `make check-installs`: Check if tooling is installed.
23
+ - `make setup`: Install/update dev tools and dependencies.
24
+
25
+ Development processes:
26
+ - `make check-rs` / `check-py` / `check-all`: Run formating, linting, and type-checking (Rust, Python, or both).
27
+ - `make test-rs` / `test-py` / `test-all`: Run tests with coverage (Rust, Python, or both).
28
+ - `make python`: Generate Python bindings for the Rust code (Runs automatically before `check-py` and `test-py`).
29
+ - `make audit`: Audit dependencies to check for supply-chain vulnerabilites.
30
+ - `make clean`: Remove build artifacts and Python bindings.
31
+
32
+ ### File tracking
33
+
34
+ We maintain `.gitignore` as a whitelist by ignoring all files by default and implicitly including only the files we actually need by prefixing them with `!`, e.g.:
35
+
36
+ ```bash
37
+ # directory
38
+ !src/
39
+
40
+ # all subdirectories
41
+ !src/**/
42
+
43
+ # only Rust files
44
+ !src/**/*.rs
45
+ ```
46
+
47
+ If you add new files to `.gitignore`, try to keep your additions reasonably concise by using wildcard patterns like in the example above.
48
+ Likewise, if you delete any files, make sure to remove any lines that are no longer necessary.
49
+
50
+ ## Tooling & Dependencies
51
+
52
+ To install and set up tooling and dependencies:
53
+ ```bash
54
+ make setup
55
+ ```
56
+
57
+ ### Rust
58
+
59
+ `adaptif` is mainly written in Rust.
60
+ Use the following command to install the Rust toolchain via Rustup, as well as the necessary Cargo extensions:
61
+
62
+ ```bash
63
+ make setup-rust
64
+ ```
65
+
66
+ ### uv
67
+
68
+ We use `uv` to manage Python dependencies and the development environment.
69
+ The following command will install/update `uv` and install the dev dependencies:
70
+
71
+ ```bash
72
+ make setup-uv
73
+ ```
74
+
75
+ `uv` automatically manages the project virtual environment in `.venv`. Manually activating it is unnecessary. Run project tools with `uv run`.
76
+
77
+ ## Python bindings
78
+
79
+ The Python package offers bindings for the Rust code via [PyO3](https://github.com/PyO3/pyo3).
80
+ To generate the Python bindings:
81
+
82
+ ```bash
83
+ make python
84
+ ```
85
+
86
+ The generated `.so` file will be placed in `python/adaptif/`
87
+
88
+ Note that `make check-py` and `make test-py` will build the bindings automatically if necessary,
89
+ no need to run `make python`.
90
+
91
+ ### Adding new bindings
92
+
93
+ New bindings should be imported in `python/adaptif/__init__.py`.
94
+ In order for `ty` to resolve imports correctly, you also have to add any new functions/classes to the stub file (`python/adaptif/adaptif.pyi`).
95
+
96
+ ## Codestyle
97
+
98
+ Format & lint the code with:
99
+
100
+ ```bash
101
+ # Rust
102
+ make check-rs
103
+
104
+ # Python
105
+ make check-py
106
+
107
+ # Both
108
+ make check-all
109
+ ```
110
+
111
+ To run the test suite:
112
+
113
+ ```bash
114
+ # Rust
115
+ make test-rs
116
+
117
+ # Python
118
+ make test-py
119
+
120
+ # Both
121
+ make test-all
122
+ ```
123
+
124
+ To run the security checks:
125
+
126
+ ```bash
127
+ make audit
128
+ ```
129
+
130
+ To remove build artifacts:
131
+
132
+ ```bash
133
+ make clean
134
+ ```
135
+
136
+ ### Before submitting
137
+
138
+ **Again, READ the section at the [top](#if-a-pr-is-submitted-with-no-issue-attached-and-a-green-light-on-working-on-a-pr-it-will-be-generally-closed-ai-prs-will-be-closed-automatically)**
139
+
140
+ Before submitting your code please do the following steps:
141
+
142
+ 1. Add tests for new changes
143
+ - _Update documentation for significant changes._
144
+ 2. Update `.gitignore` to whitelist any files you created and remove any files you deleted.
145
+ 3. Run `make check-all`
146
+ 3. Run `make test-all`
147
+ 7. Commit any changes to `Cargo.lock`/`uv.lock` if you modified project dependencies
148
+
149
+ ## Other help
150
+
151
+ You can contribute by spreading a word about this library.
152
+ You can also share your best practices with us.
153
+
154
+ ---
155
+
156
+ **In particular**, if you use this in any DSP research, please let us know!!
157
+
158
+ 1. Because we love the topic and would love to check out and share your research.
159
+ 2. It gives us an opportunity to see how this library is being used and how it can be improved.
160
+
161
+ ---
@@ -0,0 +1,363 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "adaptif"
7
+ version = "0.1.0"
8
+ dependencies = [
9
+ "hound",
10
+ "num-traits",
11
+ "numpy",
12
+ "pyo3",
13
+ "rand",
14
+ "rand_distr",
15
+ "serde",
16
+ ]
17
+
18
+ [[package]]
19
+ name = "autocfg"
20
+ version = "1.5.1"
21
+ source = "registry+https://github.com/rust-lang/crates.io-index"
22
+ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
23
+
24
+ [[package]]
25
+ name = "cfg-if"
26
+ version = "1.0.5"
27
+ source = "registry+https://github.com/rust-lang/crates.io-index"
28
+ checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
29
+
30
+ [[package]]
31
+ name = "chacha20"
32
+ version = "0.10.2"
33
+ source = "registry+https://github.com/rust-lang/crates.io-index"
34
+ checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06"
35
+ dependencies = [
36
+ "cfg-if",
37
+ "cpufeatures",
38
+ "rand_core",
39
+ ]
40
+
41
+ [[package]]
42
+ name = "cpufeatures"
43
+ version = "0.3.1"
44
+ source = "registry+https://github.com/rust-lang/crates.io-index"
45
+ checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566"
46
+ dependencies = [
47
+ "libc",
48
+ ]
49
+
50
+ [[package]]
51
+ name = "getrandom"
52
+ version = "0.4.3"
53
+ source = "registry+https://github.com/rust-lang/crates.io-index"
54
+ checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
55
+ dependencies = [
56
+ "cfg-if",
57
+ "libc",
58
+ "r-efi",
59
+ "rand_core",
60
+ ]
61
+
62
+ [[package]]
63
+ name = "heck"
64
+ version = "0.5.0"
65
+ source = "registry+https://github.com/rust-lang/crates.io-index"
66
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
67
+
68
+ [[package]]
69
+ name = "hound"
70
+ version = "3.5.1"
71
+ source = "registry+https://github.com/rust-lang/crates.io-index"
72
+ checksum = "62adaabb884c94955b19907d60019f4e145d091c75345379e70d1ee696f7854f"
73
+
74
+ [[package]]
75
+ name = "inventory"
76
+ version = "0.3.24"
77
+ source = "registry+https://github.com/rust-lang/crates.io-index"
78
+ checksum = "a4f0c30c76f2f4ccee3fe55a2435f691ca00c0e4bd87abe4f4a851b1d4dac39b"
79
+ dependencies = [
80
+ "rustversion",
81
+ ]
82
+
83
+ [[package]]
84
+ name = "libc"
85
+ version = "0.2.189"
86
+ source = "registry+https://github.com/rust-lang/crates.io-index"
87
+ checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
88
+
89
+ [[package]]
90
+ name = "libm"
91
+ version = "0.2.16"
92
+ source = "registry+https://github.com/rust-lang/crates.io-index"
93
+ checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
94
+
95
+ [[package]]
96
+ name = "matrixmultiply"
97
+ version = "0.3.11"
98
+ source = "registry+https://github.com/rust-lang/crates.io-index"
99
+ checksum = "3f607c237553f086e7043417a51df26b2eb899d3caff94e6a67592ff992fedc7"
100
+ dependencies = [
101
+ "autocfg",
102
+ "rawpointer",
103
+ ]
104
+
105
+ [[package]]
106
+ name = "ndarray"
107
+ version = "0.17.2"
108
+ source = "registry+https://github.com/rust-lang/crates.io-index"
109
+ checksum = "520080814a7a6b4a6e9070823bb24b4531daac8c4627e08ba5de8c5ef2f2752d"
110
+ dependencies = [
111
+ "matrixmultiply",
112
+ "num-complex",
113
+ "num-integer",
114
+ "num-traits",
115
+ "portable-atomic",
116
+ "portable-atomic-util",
117
+ "rawpointer",
118
+ ]
119
+
120
+ [[package]]
121
+ name = "num-complex"
122
+ version = "0.4.6"
123
+ source = "registry+https://github.com/rust-lang/crates.io-index"
124
+ checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
125
+ dependencies = [
126
+ "num-traits",
127
+ ]
128
+
129
+ [[package]]
130
+ name = "num-integer"
131
+ version = "0.1.47"
132
+ source = "registry+https://github.com/rust-lang/crates.io-index"
133
+ checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b"
134
+ dependencies = [
135
+ "num-traits",
136
+ ]
137
+
138
+ [[package]]
139
+ name = "num-traits"
140
+ version = "0.2.19"
141
+ source = "registry+https://github.com/rust-lang/crates.io-index"
142
+ checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
143
+ dependencies = [
144
+ "autocfg",
145
+ "libm",
146
+ ]
147
+
148
+ [[package]]
149
+ name = "numpy"
150
+ version = "0.30.0"
151
+ source = "registry+https://github.com/rust-lang/crates.io-index"
152
+ checksum = "aa0b9111761885449e894981fa8051dcf69e0bd114aecbd4bcdd830b6be4ed92"
153
+ dependencies = [
154
+ "libc",
155
+ "ndarray",
156
+ "num-complex",
157
+ "num-integer",
158
+ "num-traits",
159
+ "pyo3",
160
+ "pyo3-build-config",
161
+ "rustc-hash",
162
+ ]
163
+
164
+ [[package]]
165
+ name = "once_cell"
166
+ version = "1.21.4"
167
+ source = "registry+https://github.com/rust-lang/crates.io-index"
168
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
169
+
170
+ [[package]]
171
+ name = "portable-atomic"
172
+ version = "1.15.0"
173
+ source = "registry+https://github.com/rust-lang/crates.io-index"
174
+ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
175
+
176
+ [[package]]
177
+ name = "portable-atomic-util"
178
+ version = "0.2.7"
179
+ source = "registry+https://github.com/rust-lang/crates.io-index"
180
+ checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618"
181
+ dependencies = [
182
+ "portable-atomic",
183
+ ]
184
+
185
+ [[package]]
186
+ name = "proc-macro2"
187
+ version = "1.0.107"
188
+ source = "registry+https://github.com/rust-lang/crates.io-index"
189
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
190
+ dependencies = [
191
+ "unicode-ident",
192
+ ]
193
+
194
+ [[package]]
195
+ name = "pyo3"
196
+ version = "0.30.1"
197
+ source = "registry+https://github.com/rust-lang/crates.io-index"
198
+ checksum = "229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4"
199
+ dependencies = [
200
+ "inventory",
201
+ "libc",
202
+ "once_cell",
203
+ "portable-atomic",
204
+ "pyo3-build-config",
205
+ "pyo3-ffi",
206
+ "pyo3-macros",
207
+ ]
208
+
209
+ [[package]]
210
+ name = "pyo3-build-config"
211
+ version = "0.30.1"
212
+ source = "registry+https://github.com/rust-lang/crates.io-index"
213
+ checksum = "70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700"
214
+ dependencies = [
215
+ "target-lexicon",
216
+ ]
217
+
218
+ [[package]]
219
+ name = "pyo3-ffi"
220
+ version = "0.30.1"
221
+ source = "registry+https://github.com/rust-lang/crates.io-index"
222
+ checksum = "5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4"
223
+ dependencies = [
224
+ "libc",
225
+ "pyo3-build-config",
226
+ ]
227
+
228
+ [[package]]
229
+ name = "pyo3-macros"
230
+ version = "0.30.1"
231
+ source = "registry+https://github.com/rust-lang/crates.io-index"
232
+ checksum = "c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60"
233
+ dependencies = [
234
+ "proc-macro2",
235
+ "pyo3-macros-backend",
236
+ "quote",
237
+ "syn",
238
+ ]
239
+
240
+ [[package]]
241
+ name = "pyo3-macros-backend"
242
+ version = "0.30.1"
243
+ source = "registry+https://github.com/rust-lang/crates.io-index"
244
+ checksum = "38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b"
245
+ dependencies = [
246
+ "heck",
247
+ "proc-macro2",
248
+ "quote",
249
+ "syn",
250
+ ]
251
+
252
+ [[package]]
253
+ name = "quote"
254
+ version = "1.0.47"
255
+ source = "registry+https://github.com/rust-lang/crates.io-index"
256
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
257
+ dependencies = [
258
+ "proc-macro2",
259
+ ]
260
+
261
+ [[package]]
262
+ name = "r-efi"
263
+ version = "6.0.0"
264
+ source = "registry+https://github.com/rust-lang/crates.io-index"
265
+ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
266
+
267
+ [[package]]
268
+ name = "rand"
269
+ version = "0.10.3"
270
+ source = "registry+https://github.com/rust-lang/crates.io-index"
271
+ checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af"
272
+ dependencies = [
273
+ "chacha20",
274
+ "getrandom",
275
+ "rand_core",
276
+ ]
277
+
278
+ [[package]]
279
+ name = "rand_core"
280
+ version = "0.10.1"
281
+ source = "registry+https://github.com/rust-lang/crates.io-index"
282
+ checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69"
283
+
284
+ [[package]]
285
+ name = "rand_distr"
286
+ version = "0.6.0"
287
+ source = "registry+https://github.com/rust-lang/crates.io-index"
288
+ checksum = "4d431c2703ccf129de4d45253c03f49ebb22b97d6ad79ee3ecfc7e3f4862c1d8"
289
+ dependencies = [
290
+ "num-traits",
291
+ "rand",
292
+ ]
293
+
294
+ [[package]]
295
+ name = "rawpointer"
296
+ version = "0.2.1"
297
+ source = "registry+https://github.com/rust-lang/crates.io-index"
298
+ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
299
+
300
+ [[package]]
301
+ name = "rustc-hash"
302
+ version = "2.1.3"
303
+ source = "registry+https://github.com/rust-lang/crates.io-index"
304
+ checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
305
+
306
+ [[package]]
307
+ name = "rustversion"
308
+ version = "1.0.23"
309
+ source = "registry+https://github.com/rust-lang/crates.io-index"
310
+ checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
311
+
312
+ [[package]]
313
+ name = "serde"
314
+ version = "1.0.229"
315
+ source = "registry+https://github.com/rust-lang/crates.io-index"
316
+ checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
317
+ dependencies = [
318
+ "serde_core",
319
+ "serde_derive",
320
+ ]
321
+
322
+ [[package]]
323
+ name = "serde_core"
324
+ version = "1.0.229"
325
+ source = "registry+https://github.com/rust-lang/crates.io-index"
326
+ checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
327
+ dependencies = [
328
+ "serde_derive",
329
+ ]
330
+
331
+ [[package]]
332
+ name = "serde_derive"
333
+ version = "1.0.229"
334
+ source = "registry+https://github.com/rust-lang/crates.io-index"
335
+ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
336
+ dependencies = [
337
+ "proc-macro2",
338
+ "quote",
339
+ "syn",
340
+ ]
341
+
342
+ [[package]]
343
+ name = "syn"
344
+ version = "3.0.9"
345
+ source = "registry+https://github.com/rust-lang/crates.io-index"
346
+ checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
347
+ dependencies = [
348
+ "proc-macro2",
349
+ "quote",
350
+ "unicode-ident",
351
+ ]
352
+
353
+ [[package]]
354
+ name = "target-lexicon"
355
+ version = "0.13.5"
356
+ source = "registry+https://github.com/rust-lang/crates.io-index"
357
+ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
358
+
359
+ [[package]]
360
+ name = "unicode-ident"
361
+ version = "1.0.24"
362
+ source = "registry+https://github.com/rust-lang/crates.io-index"
363
+ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
@@ -0,0 +1,89 @@
1
+ [package]
2
+ name = "adaptif"
3
+ version = "0.1.0"
4
+ authors = ["Ben Glidden <benjamin.h.glidden@gmail.com>", "Elias Naske <naske.elias@outlook.com>"]
5
+ edition = "2024"
6
+ description = "Adaptive filters for digital signal processing."
7
+ readme = "README.md"
8
+ repository = "https://github.com/bglid/adaptif"
9
+ license = "MIT OR Apache-2.0"
10
+ keywords = ["signal-processing", "dsp", "audio"]
11
+ categories = [
12
+ "algorithms",
13
+ "mathematics",
14
+ "multimedia",
15
+ "multimedia::audio",
16
+ ]
17
+ include = ["/src", "/examples", "/README.md", "/CONTRIBUTING.md", "/katex-header.html"]
18
+
19
+ [lib]
20
+ name = "adaptif"
21
+ crate-type = ["cdylib", "rlib"]
22
+
23
+ [dependencies]
24
+ num-traits = "0.2.19" # TODO: use "libm" feature for no_std
25
+ pyo3 = { version = "0.30.1", optional = true, features = ["multiple-pymethods"] }
26
+ numpy = { version = "0.30.0", optional = true }
27
+ serde = { version = "1.0", optional = true, features = ["derive"] }
28
+
29
+ [features]
30
+ default = []
31
+ python = ["dep:pyo3", "dep:numpy"]
32
+ serde = ["dep:serde"]
33
+
34
+ [dev-dependencies]
35
+ hound = "3.5.1"
36
+ rand = "0.10.3"
37
+ rand_distr = "0.6.0"
38
+
39
+ [package.metadata.docs.rs]
40
+ rustdoc-args = ["--html-in-header", "katex-header.html"]
41
+
42
+ [lints.rust]
43
+ unexpected_cfgs = { level = "warn", check-cfg = ["cfg(tarpaulin_include)"]}
44
+
45
+ [lints.clippy]
46
+ pedantic = {level = "warn", priority = -1}
47
+ restriction = {level = "warn", priority = -1}
48
+ blanket_clippy_restriction_lints = "allow"
49
+ allow_attributes = "allow"
50
+
51
+ # no-brainers
52
+ arithmetic_side_effects = "allow" # otherwise we get warnings about potential overflows on _every_ arithmetic op
53
+ float_arithmetic = "allow" # used by algorithms
54
+ integer_division_remainder_used = "allow" # this lint is for cryptography
55
+ implicit_return = "allow" # leaving out the `return` keyword is idiomatic
56
+ must_use_candidate = "allow" # just shows where #[must_use] can be used
57
+ single_call_fn = "allow" # functions are useful for code organization and self-documentation
58
+ question_mark_used = "allow" # greatly simplifies error handling
59
+ absolute_paths = "allow" # fine if used within reason
60
+ missing_trait_methods = "allow" # should only be used on individual trait implementations, not globally
61
+ single_char_lifetime_names = "allow" # idiomatic
62
+
63
+ # only relevant to no_std. For embedded support, we could turn these on for the relevant modules
64
+ std_instead_of_alloc = "allow"
65
+ std_instead_of_core = "allow"
66
+
67
+ # good to have
68
+ arbitrary_source_item_ordering = "allow" # items should be ordered by importance
69
+ min_ident_chars = "allow" # to represent single-character variables used in literature
70
+ shadow_reuse = "allow" # variable shadowing is useful
71
+ default_numeric_fallback = "allow" # many false positives
72
+ separated_literal_suffix = "allow" # easier to read than unseparated
73
+ pub_use = "allow" # it's neater to keep public items in their own modules than keep them all in one mod.rs file
74
+ mod_module_files = "allow" # modules should be self-contained to a directory
75
+ let_underscore_untyped = "allow" # if we aren't going to use a return value, we generally don't care about its type
76
+ error_impl_error = "allow" # naming errors just "Error" and using them as `some_module::Error` matches the standard library
77
+ pub_with_shorthand = "allow" # stylistic choice of the pub(crate) ... shorthand over pub(in crate)
78
+ exhaustive_structs = "allow" # unlike with enums, exhaustive_structs are generally fine
79
+ rest_pattern_accessible_field = "allow" # conflicts with unneeded_field_pattern
80
+
81
+ # maybe
82
+ missing_docs_in_private_items = "allow"
83
+ expect_used = "allow" # reason is already provided, so allow macro is superfluous
84
+
85
+ # Requires short functions to be explicitly inlined, because automatic inlining can't be done across crates w/o LTO.
86
+ # This may be worth considering for the pure Rust API, but for PyO3 it's irrelevant.
87
+ # Since inlining is done at the call site, this only applies to public functions anyway.
88
+ missing_inline_in_public_items = "allow"
89
+