vectorbt-rust 1.0.0__tar.gz → 1.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.
- {vectorbt_rust-1.0.0 → vectorbt_rust-1.1.0}/Cargo.lock +65 -97
- {vectorbt_rust-1.0.0 → vectorbt_rust-1.1.0}/Cargo.toml +6 -6
- vectorbt_rust-1.1.0/PKG-INFO +169 -0
- {vectorbt_rust-1.0.0 → vectorbt_rust-1.1.0}/README.md +20 -9
- {vectorbt_rust-1.0.0 → vectorbt_rust-1.1.0}/pyproject.toml +6 -5
- {vectorbt_rust-1.0.0 → vectorbt_rust-1.1.0}/src/generic.rs +125 -125
- {vectorbt_rust-1.0.0 → vectorbt_rust-1.1.0}/src/indicators.rs +52 -52
- {vectorbt_rust-1.0.0 → vectorbt_rust-1.1.0}/src/labels.rs +26 -26
- {vectorbt_rust-1.0.0 → vectorbt_rust-1.1.0}/src/lib.rs +8 -8
- {vectorbt_rust-1.0.0 → vectorbt_rust-1.1.0}/src/portfolio.rs +88 -119
- {vectorbt_rust-1.0.0 → vectorbt_rust-1.1.0}/src/records.rs +182 -51
- {vectorbt_rust-1.0.0 → vectorbt_rust-1.1.0}/src/returns.rs +92 -98
- {vectorbt_rust-1.0.0 → vectorbt_rust-1.1.0}/src/signals.rs +48 -65
- vectorbt_rust-1.0.0/PKG-INFO +0 -22
- {vectorbt_rust-1.0.0 → vectorbt_rust-1.1.0}/rustfmt.toml +0 -0
|
@@ -4,9 +4,9 @@ version = 4
|
|
|
4
4
|
|
|
5
5
|
[[package]]
|
|
6
6
|
name = "autocfg"
|
|
7
|
-
version = "1.5.
|
|
7
|
+
version = "1.5.1"
|
|
8
8
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
-
checksum = "
|
|
9
|
+
checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
|
|
10
10
|
|
|
11
11
|
[[package]]
|
|
12
12
|
name = "cfg-if"
|
|
@@ -14,16 +14,36 @@ version = "1.0.4"
|
|
|
14
14
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
15
|
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
|
16
16
|
|
|
17
|
+
[[package]]
|
|
18
|
+
name = "chacha20"
|
|
19
|
+
version = "0.10.1"
|
|
20
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
21
|
+
checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81"
|
|
22
|
+
dependencies = [
|
|
23
|
+
"cfg-if",
|
|
24
|
+
"cpufeatures",
|
|
25
|
+
"rand_core",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[[package]]
|
|
29
|
+
name = "cpufeatures"
|
|
30
|
+
version = "0.3.0"
|
|
31
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
32
|
+
checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201"
|
|
33
|
+
dependencies = [
|
|
34
|
+
"libc",
|
|
35
|
+
]
|
|
36
|
+
|
|
17
37
|
[[package]]
|
|
18
38
|
name = "getrandom"
|
|
19
|
-
version = "0.3
|
|
39
|
+
version = "0.4.3"
|
|
20
40
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
21
|
-
checksum = "
|
|
41
|
+
checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
|
|
22
42
|
dependencies = [
|
|
23
43
|
"cfg-if",
|
|
24
44
|
"libc",
|
|
25
45
|
"r-efi",
|
|
26
|
-
"
|
|
46
|
+
"rand_core",
|
|
27
47
|
]
|
|
28
48
|
|
|
29
49
|
[[package]]
|
|
@@ -32,20 +52,11 @@ version = "0.5.0"
|
|
|
32
52
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
33
53
|
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
34
54
|
|
|
35
|
-
[[package]]
|
|
36
|
-
name = "indoc"
|
|
37
|
-
version = "2.0.7"
|
|
38
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
39
|
-
checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
|
|
40
|
-
dependencies = [
|
|
41
|
-
"rustversion",
|
|
42
|
-
]
|
|
43
|
-
|
|
44
55
|
[[package]]
|
|
45
56
|
name = "libc"
|
|
46
|
-
version = "0.2.
|
|
57
|
+
version = "0.2.186"
|
|
47
58
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
48
|
-
checksum = "
|
|
59
|
+
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
|
|
49
60
|
|
|
50
61
|
[[package]]
|
|
51
62
|
name = "matrixmultiply"
|
|
@@ -57,20 +68,11 @@ dependencies = [
|
|
|
57
68
|
"rawpointer",
|
|
58
69
|
]
|
|
59
70
|
|
|
60
|
-
[[package]]
|
|
61
|
-
name = "memoffset"
|
|
62
|
-
version = "0.9.1"
|
|
63
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
64
|
-
checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
|
|
65
|
-
dependencies = [
|
|
66
|
-
"autocfg",
|
|
67
|
-
]
|
|
68
|
-
|
|
69
71
|
[[package]]
|
|
70
72
|
name = "ndarray"
|
|
71
|
-
version = "0.
|
|
73
|
+
version = "0.17.2"
|
|
72
74
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
73
|
-
checksum = "
|
|
75
|
+
checksum = "520080814a7a6b4a6e9070823bb24b4531daac8c4627e08ba5de8c5ef2f2752d"
|
|
74
76
|
dependencies = [
|
|
75
77
|
"matrixmultiply",
|
|
76
78
|
"num-complex",
|
|
@@ -110,9 +112,9 @@ dependencies = [
|
|
|
110
112
|
|
|
111
113
|
[[package]]
|
|
112
114
|
name = "numpy"
|
|
113
|
-
version = "0.
|
|
115
|
+
version = "0.29.0"
|
|
114
116
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
115
|
-
checksum = "
|
|
117
|
+
checksum = "6a5b15d63a5ff39e378daed0e1340d3a5964703ea9712eb09a0dc66fade996f4"
|
|
116
118
|
dependencies = [
|
|
117
119
|
"libc",
|
|
118
120
|
"ndarray",
|
|
@@ -120,6 +122,7 @@ dependencies = [
|
|
|
120
122
|
"num-integer",
|
|
121
123
|
"num-traits",
|
|
122
124
|
"pyo3",
|
|
125
|
+
"pyo3-build-config",
|
|
123
126
|
"rustc-hash",
|
|
124
127
|
]
|
|
125
128
|
|
|
@@ -164,37 +167,32 @@ dependencies = [
|
|
|
164
167
|
|
|
165
168
|
[[package]]
|
|
166
169
|
name = "pyo3"
|
|
167
|
-
version = "0.
|
|
170
|
+
version = "0.29.0"
|
|
168
171
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
169
|
-
checksum = "
|
|
172
|
+
checksum = "cd274650b21d4bfc26a0a47587962c1edb425f69287324355cd040c3ea66071c"
|
|
170
173
|
dependencies = [
|
|
171
|
-
"cfg-if",
|
|
172
|
-
"indoc",
|
|
173
174
|
"libc",
|
|
174
|
-
"memoffset",
|
|
175
175
|
"once_cell",
|
|
176
176
|
"portable-atomic",
|
|
177
177
|
"pyo3-build-config",
|
|
178
178
|
"pyo3-ffi",
|
|
179
179
|
"pyo3-macros",
|
|
180
|
-
"unindent",
|
|
181
180
|
]
|
|
182
181
|
|
|
183
182
|
[[package]]
|
|
184
183
|
name = "pyo3-build-config"
|
|
185
|
-
version = "0.
|
|
184
|
+
version = "0.29.0"
|
|
186
185
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
187
|
-
checksum = "
|
|
186
|
+
checksum = "c5e2a7d2f0d013342f295c048ad19237add5154a55b1c5a254c0ec93d4109078"
|
|
188
187
|
dependencies = [
|
|
189
|
-
"once_cell",
|
|
190
188
|
"target-lexicon",
|
|
191
189
|
]
|
|
192
190
|
|
|
193
191
|
[[package]]
|
|
194
192
|
name = "pyo3-ffi"
|
|
195
|
-
version = "0.
|
|
193
|
+
version = "0.29.0"
|
|
196
194
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
197
|
-
checksum = "
|
|
195
|
+
checksum = "ca85c467da1bbc8d866eea5deff9cf29ea5f7785054a17da36e65bda9c05845b"
|
|
198
196
|
dependencies = [
|
|
199
197
|
"libc",
|
|
200
198
|
"pyo3-build-config",
|
|
@@ -202,9 +200,9 @@ dependencies = [
|
|
|
202
200
|
|
|
203
201
|
[[package]]
|
|
204
202
|
name = "pyo3-macros"
|
|
205
|
-
version = "0.
|
|
203
|
+
version = "0.29.0"
|
|
206
204
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
207
|
-
checksum = "
|
|
205
|
+
checksum = "9ac53762fd065daa3194dd09337a38bd793a188100fd1a9304c4ab312d901771"
|
|
208
206
|
dependencies = [
|
|
209
207
|
"proc-macro2",
|
|
210
208
|
"pyo3-macros-backend",
|
|
@@ -214,47 +212,47 @@ dependencies = [
|
|
|
214
212
|
|
|
215
213
|
[[package]]
|
|
216
214
|
name = "pyo3-macros-backend"
|
|
217
|
-
version = "0.
|
|
215
|
+
version = "0.29.0"
|
|
218
216
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
219
|
-
checksum = "
|
|
217
|
+
checksum = "4ca3a1557399783172dc5bf39cfca835157732532cba56b71d2292161e53b362"
|
|
220
218
|
dependencies = [
|
|
221
219
|
"heck",
|
|
222
220
|
"proc-macro2",
|
|
223
|
-
"pyo3-build-config",
|
|
224
221
|
"quote",
|
|
225
222
|
"syn",
|
|
226
223
|
]
|
|
227
224
|
|
|
228
225
|
[[package]]
|
|
229
226
|
name = "quote"
|
|
230
|
-
version = "1.0.
|
|
227
|
+
version = "1.0.46"
|
|
231
228
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
232
|
-
checksum = "
|
|
229
|
+
checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368"
|
|
233
230
|
dependencies = [
|
|
234
231
|
"proc-macro2",
|
|
235
232
|
]
|
|
236
233
|
|
|
237
234
|
[[package]]
|
|
238
235
|
name = "r-efi"
|
|
239
|
-
version = "
|
|
236
|
+
version = "6.0.0"
|
|
240
237
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
241
|
-
checksum = "
|
|
238
|
+
checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
|
|
242
239
|
|
|
243
240
|
[[package]]
|
|
244
241
|
name = "rand"
|
|
245
|
-
version = "0.
|
|
242
|
+
version = "0.10.2"
|
|
246
243
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
247
|
-
checksum = "
|
|
244
|
+
checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80"
|
|
248
245
|
dependencies = [
|
|
249
|
-
"
|
|
246
|
+
"chacha20",
|
|
247
|
+
"getrandom",
|
|
250
248
|
"rand_core",
|
|
251
249
|
]
|
|
252
250
|
|
|
253
251
|
[[package]]
|
|
254
252
|
name = "rand_chacha"
|
|
255
|
-
version = "0.
|
|
253
|
+
version = "0.10.0"
|
|
256
254
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
257
|
-
checksum = "
|
|
255
|
+
checksum = "3e6af7f3e25ded52c41df4e0b1af2d047e45896c2f3281792ed68a1c243daedb"
|
|
258
256
|
dependencies = [
|
|
259
257
|
"ppv-lite86",
|
|
260
258
|
"rand_core",
|
|
@@ -262,12 +260,9 @@ dependencies = [
|
|
|
262
260
|
|
|
263
261
|
[[package]]
|
|
264
262
|
name = "rand_core"
|
|
265
|
-
version = "0.
|
|
263
|
+
version = "0.10.1"
|
|
266
264
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
267
|
-
checksum = "
|
|
268
|
-
dependencies = [
|
|
269
|
-
"getrandom",
|
|
270
|
-
]
|
|
265
|
+
checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69"
|
|
271
266
|
|
|
272
267
|
[[package]]
|
|
273
268
|
name = "rawpointer"
|
|
@@ -277,21 +272,15 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
|
|
|
277
272
|
|
|
278
273
|
[[package]]
|
|
279
274
|
name = "rustc-hash"
|
|
280
|
-
version = "
|
|
281
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
282
|
-
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
|
283
|
-
|
|
284
|
-
[[package]]
|
|
285
|
-
name = "rustversion"
|
|
286
|
-
version = "1.0.22"
|
|
275
|
+
version = "2.1.3"
|
|
287
276
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
288
|
-
checksum = "
|
|
277
|
+
checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
|
|
289
278
|
|
|
290
279
|
[[package]]
|
|
291
280
|
name = "syn"
|
|
292
|
-
version = "2.0.
|
|
281
|
+
version = "2.0.118"
|
|
293
282
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
294
|
-
checksum = "
|
|
283
|
+
checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422"
|
|
295
284
|
dependencies = [
|
|
296
285
|
"proc-macro2",
|
|
297
286
|
"quote",
|
|
@@ -300,9 +289,9 @@ dependencies = [
|
|
|
300
289
|
|
|
301
290
|
[[package]]
|
|
302
291
|
name = "target-lexicon"
|
|
303
|
-
version = "0.
|
|
292
|
+
version = "0.13.5"
|
|
304
293
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
305
|
-
checksum = "
|
|
294
|
+
checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
|
|
306
295
|
|
|
307
296
|
[[package]]
|
|
308
297
|
name = "unicode-ident"
|
|
@@ -310,15 +299,9 @@ version = "1.0.24"
|
|
|
310
299
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
311
300
|
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
|
312
301
|
|
|
313
|
-
[[package]]
|
|
314
|
-
name = "unindent"
|
|
315
|
-
version = "0.2.4"
|
|
316
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
317
|
-
checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
|
|
318
|
-
|
|
319
302
|
[[package]]
|
|
320
303
|
name = "vectorbt-rust"
|
|
321
|
-
version = "1.
|
|
304
|
+
version = "1.1.0"
|
|
322
305
|
dependencies = [
|
|
323
306
|
"ndarray",
|
|
324
307
|
"numpy",
|
|
@@ -327,35 +310,20 @@ dependencies = [
|
|
|
327
310
|
"rand_chacha",
|
|
328
311
|
]
|
|
329
312
|
|
|
330
|
-
[[package]]
|
|
331
|
-
name = "wasip2"
|
|
332
|
-
version = "1.0.3+wasi-0.2.9"
|
|
333
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
334
|
-
checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6"
|
|
335
|
-
dependencies = [
|
|
336
|
-
"wit-bindgen",
|
|
337
|
-
]
|
|
338
|
-
|
|
339
|
-
[[package]]
|
|
340
|
-
name = "wit-bindgen"
|
|
341
|
-
version = "0.57.1"
|
|
342
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
343
|
-
checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"
|
|
344
|
-
|
|
345
313
|
[[package]]
|
|
346
314
|
name = "zerocopy"
|
|
347
|
-
version = "0.8.
|
|
315
|
+
version = "0.8.52"
|
|
348
316
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
349
|
-
checksum = "
|
|
317
|
+
checksum = "ce1022995ff5ff5d841ad7d994facc23098cd40152f2c1d11cd607c6f530653f"
|
|
350
318
|
dependencies = [
|
|
351
319
|
"zerocopy-derive",
|
|
352
320
|
]
|
|
353
321
|
|
|
354
322
|
[[package]]
|
|
355
323
|
name = "zerocopy-derive"
|
|
356
|
-
version = "0.8.
|
|
324
|
+
version = "0.8.52"
|
|
357
325
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
358
|
-
checksum = "
|
|
326
|
+
checksum = "1ae7f38b72ec2a254e2b87ef277cf2cd4fb97cbebf944faa6f33354da0867930"
|
|
359
327
|
dependencies = [
|
|
360
328
|
"proc-macro2",
|
|
361
329
|
"quote",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "vectorbt-rust"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.1.0"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
description = "Rust-accelerated kernels for vectorbt"
|
|
6
6
|
license = "Apache-2.0 WITH Commons-Clause-1.0"
|
|
@@ -11,11 +11,11 @@ name = "vectorbt_rust"
|
|
|
11
11
|
crate-type = ["cdylib"]
|
|
12
12
|
|
|
13
13
|
[dependencies]
|
|
14
|
-
pyo3 = { version = "0.
|
|
15
|
-
numpy = "0.
|
|
16
|
-
ndarray = "0.
|
|
17
|
-
rand = "0.
|
|
18
|
-
rand_chacha = "0.
|
|
14
|
+
pyo3 = { version = "0.29", features = ["extension-module"] }
|
|
15
|
+
numpy = "0.29"
|
|
16
|
+
ndarray = "0.17"
|
|
17
|
+
rand = "0.10"
|
|
18
|
+
rand_chacha = "0.10"
|
|
19
19
|
|
|
20
20
|
[profile.release]
|
|
21
21
|
lto = true
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vectorbt-rust
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Classifier: Development Status :: 3 - Alpha
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
11
|
+
Classifier: Programming Language :: Rust
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Topic :: Software Development
|
|
15
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
17
|
+
Requires-Dist: numpy>=2.4.6
|
|
18
|
+
Summary: Rust-accelerated kernels for vectorbt
|
|
19
|
+
Author-email: Oleg Polakow <olegpolakow@vectorbt.pro>
|
|
20
|
+
License: Apache-2.0 WITH Commons-Clause-1.0
|
|
21
|
+
Requires-Python: >=3.11, <3.15
|
|
22
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
23
|
+
Project-URL: Homepage, https://github.com/polakowo/vectorbt
|
|
24
|
+
|
|
25
|
+
<h1 align="center">vectorbt Rust Engine</h1>
|
|
26
|
+
|
|
27
|
+
<p align="center">
|
|
28
|
+
<a href="https://pypi.org/project/vectorbt-rust" title="PyPI">
|
|
29
|
+
<img src="https://img.shields.io/pypi/v/vectorbt-rust?color=blueviolet" />
|
|
30
|
+
</a>
|
|
31
|
+
<a href="https://pypi.org/project/vectorbt-rust" title="Python">
|
|
32
|
+
<img src="https://img.shields.io/pypi/pyversions/vectorbt-rust" />
|
|
33
|
+
</a>
|
|
34
|
+
<a href="https://www.rust-lang.org" title="Built with Rust">
|
|
35
|
+
<img src="https://img.shields.io/badge/built_with-Rust-dea584?logo=rust" />
|
|
36
|
+
</a>
|
|
37
|
+
<a href="https://github.com/polakowo/vectorbt/blob/master/LICENSE.md" title="License">
|
|
38
|
+
<img src="https://img.shields.io/badge/license-Fair%20Code-yellow" />
|
|
39
|
+
</a>
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
Optional Rust acceleration engine for [vectorbt](https://github.com/polakowo/vectorbt).
|
|
43
|
+
Provides high-performance drop-in replacements for vectorbt's Numba kernels,
|
|
44
|
+
dispatched transparently via `engine="rust"` or the global engine setting.
|
|
45
|
+
|
|
46
|
+
> [!NOTE]
|
|
47
|
+
> Most users should not import `vectorbt_rust` directly. Prefer vectorbt's public
|
|
48
|
+
> APIs and pass `engine="rust"` or set the global engine.
|
|
49
|
+
|
|
50
|
+
## Installation
|
|
51
|
+
|
|
52
|
+
Install the Rust extension together with vectorbt:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pip install "vectorbt[rust]"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Or install the Rust extension package directly:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install vectorbt-rust
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`vectorbt-rust` must be version-compatible with `vectorbt`. The engine resolver
|
|
65
|
+
compares the major/minor version prefix and treats mismatches as unavailable.
|
|
66
|
+
|
|
67
|
+
### Building from source
|
|
68
|
+
|
|
69
|
+
From the repository root:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
python -m pip install -U pip maturin
|
|
73
|
+
python -m pip install -e ".[test]"
|
|
74
|
+
python -m maturin develop --manifest-path rust/Cargo.toml --release
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
You can also build from inside this directory:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
cd rust
|
|
81
|
+
python -m maturin develop --release
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The release profile enables LTO, one codegen unit, `opt-level = 3`, and symbol
|
|
85
|
+
stripping. Use release builds for benchmarks; debug builds are not representative.
|
|
86
|
+
|
|
87
|
+
## Usage
|
|
88
|
+
|
|
89
|
+
The shared resolver lives in `vectorbt/_engine.py`.
|
|
90
|
+
|
|
91
|
+
Per call:
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
import vectorbt as vbt
|
|
95
|
+
|
|
96
|
+
out = vbt.MA.run(close, window=20, engine="rust")
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Globally:
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
import vectorbt as vbt
|
|
103
|
+
|
|
104
|
+
vbt.settings["engine"] = "rust"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Supported engine values:
|
|
108
|
+
|
|
109
|
+
- `auto`: Use Rust when it is installed, version-compatible, and the specific
|
|
110
|
+
call is supported; otherwise fall back to Numba.
|
|
111
|
+
- `numba`: Force the Numba implementation.
|
|
112
|
+
- `rust`: Force Rust and raise an actionable error if Rust is unavailable or the
|
|
113
|
+
call is unsupported.
|
|
114
|
+
|
|
115
|
+
Randomized functions are special: `auto` keeps using Numba to preserve legacy
|
|
116
|
+
NumPy/Numba random streams. Use `engine="rust"` explicitly when you want the
|
|
117
|
+
Rust random implementation.
|
|
118
|
+
|
|
119
|
+
## Compatibility
|
|
120
|
+
|
|
121
|
+
The current Rust engine targets NumPy arrays and deterministic, array-oriented
|
|
122
|
+
kernels. Some public Python APIs still intentionally resolve to Numba when Rust
|
|
123
|
+
cannot preserve behavior, such as callback-accepting functions or unsupported
|
|
124
|
+
input combinations.
|
|
125
|
+
|
|
126
|
+
## Testing
|
|
127
|
+
|
|
128
|
+
Run the engine-focused tests from the repository root:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
pytest tests/test_engine.py
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Run the full test suite:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
pytest
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Tests that require Rust are skipped when `vectorbt-rust` is not installed or not
|
|
141
|
+
version-compatible. To force those paths locally, install the extension with
|
|
142
|
+
`maturin develop` first.
|
|
143
|
+
|
|
144
|
+
## Benchmarks
|
|
145
|
+
|
|
146
|
+
The benchmark scripts live in [benchmarks](../benchmarks).
|
|
147
|
+
|
|
148
|
+
Generate markdown benchmark matrices:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
python benchmarks/bench_matrix.py
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Use release builds for any benchmark numbers you intend to publish.
|
|
155
|
+
|
|
156
|
+
## New kernels
|
|
157
|
+
|
|
158
|
+
New Rust kernels should follow this process:
|
|
159
|
+
|
|
160
|
+
1. Treat Numba as the reference.
|
|
161
|
+
2. Implement the Rust kernel with the same argument order and return shape.
|
|
162
|
+
3. Register the PyO3 function in the Rust submodule and wire new submodules in `src/lib.rs`.
|
|
163
|
+
4. Add or update the dispatch wrapper.
|
|
164
|
+
5. Add parity, fallback, explicit-error, and layout-sensitive tests.
|
|
165
|
+
6. Add benchmark cases once parity is stable.
|
|
166
|
+
|
|
167
|
+
Keep changes narrow and mechanical. Do not import Rust from `nb.py`, and do not
|
|
168
|
+
make public callers import `vectorbt_rust` directly.
|
|
169
|
+
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
<h1 align="center">vectorbt Rust Engine</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://pypi.org/project/vectorbt-rust" title="PyPI">
|
|
5
|
+
<img src="https://img.shields.io/pypi/v/vectorbt-rust?color=blueviolet" />
|
|
6
|
+
</a>
|
|
7
|
+
<a href="https://pypi.org/project/vectorbt-rust" title="Python">
|
|
8
|
+
<img src="https://img.shields.io/pypi/pyversions/vectorbt-rust" />
|
|
9
|
+
</a>
|
|
10
|
+
<a href="https://www.rust-lang.org" title="Built with Rust">
|
|
11
|
+
<img src="https://img.shields.io/badge/built_with-Rust-dea584?logo=rust" />
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://github.com/polakowo/vectorbt/blob/master/LICENSE.md" title="License">
|
|
14
|
+
<img src="https://img.shields.io/badge/license-Fair%20Code-yellow" />
|
|
15
|
+
</a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
Optional Rust acceleration engine for [vectorbt](https://github.com/polakowo/vectorbt).
|
|
19
|
+
Provides high-performance drop-in replacements for vectorbt's Numba kernels,
|
|
20
|
+
dispatched transparently via `engine="rust"` or the global engine setting.
|
|
10
21
|
|
|
11
22
|
> [!NOTE]
|
|
12
23
|
> Most users should not import `vectorbt_rust` directly. Prefer vectorbt's public
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["maturin>=1.
|
|
2
|
+
requires = ["maturin>=1.14,<2.0"]
|
|
3
3
|
build-backend = "maturin"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "vectorbt-rust"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.1.0"
|
|
8
8
|
description = "Rust-accelerated kernels for vectorbt"
|
|
9
|
+
readme = "README.md"
|
|
9
10
|
license = {text = "Apache-2.0 WITH Commons-Clause-1.0"}
|
|
10
11
|
authors = [
|
|
11
12
|
{name = "Oleg Polakow", email = "olegpolakow@vectorbt.pro"}
|
|
12
13
|
]
|
|
13
|
-
requires-python = ">=3.
|
|
14
|
+
requires-python = ">=3.11,<3.15"
|
|
14
15
|
classifiers = [
|
|
15
16
|
"Development Status :: 3 - Alpha",
|
|
16
17
|
"Intended Audience :: Developers",
|
|
17
18
|
"Intended Audience :: Financial and Insurance Industry",
|
|
18
|
-
"Programming Language :: Python :: 3.10",
|
|
19
19
|
"Programming Language :: Python :: 3.11",
|
|
20
20
|
"Programming Language :: Python :: 3.12",
|
|
21
21
|
"Programming Language :: Python :: 3.13",
|
|
22
|
+
"Programming Language :: Python :: 3.14",
|
|
22
23
|
"Programming Language :: Rust",
|
|
23
24
|
"Operating System :: OS Independent",
|
|
24
25
|
"Intended Audience :: Science/Research",
|
|
@@ -26,7 +27,7 @@ classifiers = [
|
|
|
26
27
|
"Topic :: Office/Business :: Financial",
|
|
27
28
|
"Topic :: Scientific/Engineering :: Information Analysis",
|
|
28
29
|
]
|
|
29
|
-
dependencies = ["numpy>=
|
|
30
|
+
dependencies = ["numpy>=2.4.6"]
|
|
30
31
|
|
|
31
32
|
[project.urls]
|
|
32
33
|
Homepage = "https://github.com/polakowo/vectorbt"
|