py-alpha-lib 0.3.0__tar.gz → 0.3.3__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 (79) hide show
  1. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/Cargo.lock +39 -28
  2. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/Cargo.toml +8 -3
  3. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/PKG-INFO +6 -2
  4. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/README.md +4 -0
  5. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/build.rs +1072 -93
  6. py_alpha_lib-0.3.3/alpha-algo/src/algo/elementwise.rs +247 -0
  7. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/ema.rs +291 -2
  8. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/extremum.rs +223 -0
  9. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/ma.rs +114 -0
  10. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/mod.rs +2 -0
  11. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/rank.rs +96 -29
  12. py_alpha_lib-0.3.3/alpha-algo/src/algo/series.rs +792 -0
  13. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/sharpe.rs +4 -2
  14. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/split.rs +269 -2
  15. py_alpha_lib-0.3.3/alpha-algo/src/join.rs +408 -0
  16. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/lib.rs +2 -0
  17. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/Cargo.toml +1 -1
  18. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/README.md +4 -0
  19. py_alpha_lib-0.3.3/py-binding/python/tests/test_ref_v.py +77 -0
  20. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/python/tests/test_split.py +25 -1
  21. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/src/algo_bindings.rs +1671 -86
  22. py_alpha_lib-0.3.3/py-binding/tests/rank.py +54 -0
  23. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/pyproject.toml +1 -1
  24. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/python/alpha/algo/algo_gen.py +472 -2
  25. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/python/alpha/algo.md +24 -2
  26. py_alpha_lib-0.3.0/alpha-algo/src/algo/series.rs +0 -291
  27. py_alpha_lib-0.3.0/py-binding/tests/rank.py +0 -16
  28. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/LICENSE +0 -0
  29. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/Cargo.toml +0 -0
  30. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/alpha.rs +0 -0
  31. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/backfill.rs +0 -0
  32. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/beta.rs +0 -0
  33. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/context.rs +0 -0
  34. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/cross.rs +0 -0
  35. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/drawdown.rs +0 -0
  36. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/entropy.rs +0 -0
  37. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/error.rs +0 -0
  38. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/group.rs +0 -0
  39. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/misc.rs +0 -0
  40. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/moments.rs +0 -0
  41. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/neutralize.rs +0 -0
  42. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/quantile.rs +0 -0
  43. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/returns.rs +0 -0
  44. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/scan.rs +0 -0
  45. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/skip_nan_window.rs +0 -0
  46. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/slope.rs +0 -0
  47. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/stats.rs +0 -0
  48. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/stddev.rs +0 -0
  49. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/sum.rs +0 -0
  50. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/alpha-algo/src/algo/zscore.rs +0 -0
  51. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/LICENSE +0 -0
  52. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/alpha/__init__.py +0 -0
  53. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/alpha/algo/__init__.py +0 -0
  54. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/alpha/algo/algo.py +0 -0
  55. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/alpha/algo/algo_gen.py +0 -0
  56. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/alpha/algo.md +0 -0
  57. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/alpha/context.py +0 -0
  58. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/alpha/lang/__init__.py +0 -0
  59. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/alpha/lang/__main__.py +0 -0
  60. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/alpha/lang/alpha.lark +0 -0
  61. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/alpha/lang/parser.py +0 -0
  62. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/alpha/lang/to_python.py +0 -0
  63. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/python/conftest.py +0 -0
  64. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/python/tests/test_grammar.py +0 -0
  65. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/python/tests/test_rank.py +0 -0
  66. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/python/tests/test_talib.py +0 -0
  67. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/python/tests/test_to_python.py +0 -0
  68. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/src/lib.rs +0 -0
  69. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/tests/usage.py +0 -0
  70. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/py-binding/tests/verify_sumif.py +0 -0
  71. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/python/alpha/__init__.py +0 -0
  72. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/python/alpha/algo/__init__.py +0 -0
  73. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/python/alpha/algo/algo.py +0 -0
  74. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/python/alpha/context.py +0 -0
  75. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/python/alpha/lang/__init__.py +0 -0
  76. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/python/alpha/lang/__main__.py +0 -0
  77. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/python/alpha/lang/alpha.lark +0 -0
  78. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/python/alpha/lang/parser.py +0 -0
  79. {py_alpha_lib-0.3.0 → py_alpha_lib-0.3.3}/python/alpha/lang/to_python.py +0 -0
@@ -4,7 +4,7 @@ version = 4
4
4
 
5
5
  [[package]]
6
6
  name = "alpha"
7
- version = "0.3.0"
7
+ version = "0.3.3"
8
8
  dependencies = [
9
9
  "alpha-algo",
10
10
  "anyhow",
@@ -19,7 +19,7 @@ dependencies = [
19
19
 
20
20
  [[package]]
21
21
  name = "alpha-algo"
22
- version = "0.3.0"
22
+ version = "0.3.3"
23
23
  dependencies = [
24
24
  "anyhow",
25
25
  "mlua",
@@ -52,7 +52,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb"
52
52
  dependencies = [
53
53
  "proc-macro2",
54
54
  "quote",
55
- "syn",
55
+ "syn 2.0.114",
56
56
  ]
57
57
 
58
58
  [[package]]
@@ -238,8 +238,9 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
238
238
 
239
239
  [[package]]
240
240
  name = "js-alpha-lib"
241
- version = "0.3.0"
241
+ version = "0.3.3"
242
242
  dependencies = [
243
+ "alpha-algo",
243
244
  "console_error_panic_hook",
244
245
  "mlang",
245
246
  "wasm-bindgen",
@@ -287,7 +288,7 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
287
288
 
288
289
  [[package]]
289
290
  name = "lua-alpha-lib"
290
- version = "0.3.0"
291
+ version = "0.3.3"
291
292
  dependencies = [
292
293
  "alpha-algo",
293
294
  "anyhow",
@@ -344,7 +345,7 @@ dependencies = [
344
345
 
345
346
  [[package]]
346
347
  name = "mlang"
347
- version = "0.3.0"
348
+ version = "0.3.3"
348
349
  dependencies = [
349
350
  "alpha-algo",
350
351
  "anyhow",
@@ -437,9 +438,9 @@ dependencies = [
437
438
 
438
439
  [[package]]
439
440
  name = "numpy"
440
- version = "0.28.0"
441
+ version = "0.30.0"
441
442
  source = "registry+https://github.com/rust-lang/crates.io-index"
442
- checksum = "778da78c64ddc928ebf5ad9df5edf0789410ff3bdbf3619aed51cd789a6af1e2"
443
+ checksum = "aa0b9111761885449e894981fa8051dcf69e0bd114aecbd4bcdd830b6be4ed92"
443
444
  dependencies = [
444
445
  "libc",
445
446
  "ndarray",
@@ -516,7 +517,7 @@ dependencies = [
516
517
  "pest_meta",
517
518
  "proc-macro2",
518
519
  "quote",
519
- "syn",
520
+ "syn 2.0.114",
520
521
  ]
521
522
 
522
523
  [[package]]
@@ -567,9 +568,9 @@ dependencies = [
567
568
 
568
569
  [[package]]
569
570
  name = "pyo3"
570
- version = "0.28.2"
571
+ version = "0.30.1"
571
572
  source = "registry+https://github.com/rust-lang/crates.io-index"
572
- checksum = "cf85e27e86080aafd5a22eae58a162e133a589551542b3e5cee4beb27e54f8e1"
573
+ checksum = "229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4"
573
574
  dependencies = [
574
575
  "libc",
575
576
  "once_cell",
@@ -581,18 +582,18 @@ dependencies = [
581
582
 
582
583
  [[package]]
583
584
  name = "pyo3-build-config"
584
- version = "0.28.2"
585
+ version = "0.30.1"
585
586
  source = "registry+https://github.com/rust-lang/crates.io-index"
586
- checksum = "8bf94ee265674bf76c09fa430b0e99c26e319c945d96ca0d5a8215f31bf81cf7"
587
+ checksum = "70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700"
587
588
  dependencies = [
588
589
  "target-lexicon",
589
590
  ]
590
591
 
591
592
  [[package]]
592
593
  name = "pyo3-ffi"
593
- version = "0.28.2"
594
+ version = "0.30.1"
594
595
  source = "registry+https://github.com/rust-lang/crates.io-index"
595
- checksum = "491aa5fc66d8059dd44a75f4580a2962c1862a1c2945359db36f6c2818b748dc"
596
+ checksum = "5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4"
596
597
  dependencies = [
597
598
  "libc",
598
599
  "pyo3-build-config",
@@ -600,9 +601,9 @@ dependencies = [
600
601
 
601
602
  [[package]]
602
603
  name = "pyo3-log"
603
- version = "0.13.3"
604
+ version = "0.13.5"
604
605
  source = "registry+https://github.com/rust-lang/crates.io-index"
605
- checksum = "26c2ec80932c5c3b2d4fbc578c9b56b2d4502098587edb8bef5b6bfcad43682e"
606
+ checksum = "b91aabf1c0d674a2e3b0b55daab6cef1308ce6f0ad3697ae56f4f68db54c98a1"
606
607
  dependencies = [
607
608
  "arc-swap",
608
609
  "log",
@@ -611,27 +612,26 @@ dependencies = [
611
612
 
612
613
  [[package]]
613
614
  name = "pyo3-macros"
614
- version = "0.28.2"
615
+ version = "0.30.1"
615
616
  source = "registry+https://github.com/rust-lang/crates.io-index"
616
- checksum = "f5d671734e9d7a43449f8480f8b38115df67bef8d21f76837fa75ee7aaa5e52e"
617
+ checksum = "c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60"
617
618
  dependencies = [
618
619
  "proc-macro2",
619
620
  "pyo3-macros-backend",
620
621
  "quote",
621
- "syn",
622
+ "syn 3.0.9",
622
623
  ]
623
624
 
624
625
  [[package]]
625
626
  name = "pyo3-macros-backend"
626
- version = "0.28.2"
627
+ version = "0.30.1"
627
628
  source = "registry+https://github.com/rust-lang/crates.io-index"
628
- checksum = "22faaa1ce6c430a1f71658760497291065e6450d7b5dc2bcf254d49f66ee700a"
629
+ checksum = "38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b"
629
630
  dependencies = [
630
631
  "heck",
631
632
  "proc-macro2",
632
- "pyo3-build-config",
633
633
  "quote",
634
- "syn",
634
+ "syn 3.0.9",
635
635
  ]
636
636
 
637
637
  [[package]]
@@ -732,7 +732,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
732
732
  dependencies = [
733
733
  "proc-macro2",
734
734
  "quote",
735
- "syn",
735
+ "syn 2.0.114",
736
736
  ]
737
737
 
738
738
  [[package]]
@@ -788,6 +788,17 @@ dependencies = [
788
788
  "unicode-ident",
789
789
  ]
790
790
 
791
+ [[package]]
792
+ name = "syn"
793
+ version = "3.0.9"
794
+ source = "registry+https://github.com/rust-lang/crates.io-index"
795
+ checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
796
+ dependencies = [
797
+ "proc-macro2",
798
+ "quote",
799
+ "unicode-ident",
800
+ ]
801
+
791
802
  [[package]]
792
803
  name = "target-lexicon"
793
804
  version = "0.13.4"
@@ -811,7 +822,7 @@ checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
811
822
  dependencies = [
812
823
  "proc-macro2",
813
824
  "quote",
814
- "syn",
825
+ "syn 2.0.114",
815
826
  ]
816
827
 
817
828
  [[package]]
@@ -890,7 +901,7 @@ dependencies = [
890
901
  "bumpalo",
891
902
  "proc-macro2",
892
903
  "quote",
893
- "syn",
904
+ "syn 2.0.114",
894
905
  "wasm-bindgen-shared",
895
906
  ]
896
907
 
@@ -933,7 +944,7 @@ checksum = "e925354648d2a4d1bf205412e36d520a800280622eef4719678d268e5d40e978"
933
944
  dependencies = [
934
945
  "proc-macro2",
935
946
  "quote",
936
- "syn",
947
+ "syn 2.0.114",
937
948
  ]
938
949
 
939
950
  [[package]]
@@ -3,14 +3,14 @@ members = ["alpha-algo", "py-binding"]
3
3
  resolver = "3"
4
4
 
5
5
  [workspace.package]
6
- version = "0.3.0"
6
+ version = "0.3.3"
7
7
  authors = ["ElseJJ"]
8
8
  edition = "2024"
9
9
 
10
10
  [workspace.dependencies]
11
11
  log = "0.4"
12
12
  num-traits = "0.2"
13
- numpy = "0.28"
13
+ numpy = "0.30"
14
14
  pyo3-log = "0.13"
15
15
  rayon = "1.11"
16
16
  thiserror = "2"
@@ -18,4 +18,9 @@ anyhow = "1"
18
18
  mlua = { version = "0.11", features = ["lua55", "vendored", "anyhow"] }
19
19
 
20
20
  [workspace.dependencies.pyo3]
21
- version = "0.28"
21
+ version = "0.30"
22
+
23
+
24
+ [profile.wasm]
25
+ inherits = "release"
26
+ opt-level = "s"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py-alpha-lib
3
- Version: 0.3.0
3
+ Version: 0.3.3
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -9,7 +9,7 @@ License-File: LICENSE
9
9
  Summary: Alpha Library: A high-performance rolling window calculation library implemented in Rust with Python bindings. Used for financial data analysis and factor research.
10
10
  Keywords: financial data analysis,factor research,technical indicator calculation
11
11
  Author: ElseJJ
12
- Requires-Python: >=3.11
12
+ Requires-Python: >=3.12
13
13
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
14
14
  Project-URL: repository, https://github.com/msd-rs/py-alpha-lib
15
15
 
@@ -178,6 +178,8 @@ Naming Rules:
178
178
  | BARSSINCE | Calculate number of bars since first condition true |
179
179
  | BETA | Rolling Beta coefficient of asset returns against benchmark returns. |
180
180
  | BINS | Discretize the input into n bins, the ctx.groups() is the number of groups |
181
+ | BW_SPLIT | Backward split and dividend adjustment |
182
+ | BW_SPLIT_FACTOR | Backward split factor calculation |
181
183
  | CC_RANK | Calculate rank percentage cross group dimension, the ctx.groups() is the number of groups Same value are averaged |
182
184
  | CC_ZSCORE | Calculate cross-sectional Z-Score across groups at each time step |
183
185
  | CORR | Time Series Correlation in moving window on self |
@@ -190,6 +192,8 @@ Naming Rules:
190
192
  | EMA | Exponential Moving Average (variant of well-known EMA) weight = 2 / (n + 1) |
191
193
  | ENTROPY | Calculate rolling Shannon entropy over a moving window |
192
194
  | FRET | Future Return |
195
+ | FW_SPLIT | Forward split and dividend adjustment |
196
+ | FW_SPLIT_FACTOR | Forward split factor calculation |
193
197
  | GROUP_RANK | Calculate rank percentage within each category group at each time step |
194
198
  | GROUP_ZSCORE | Calculate Z-Score within each category group at each time step |
195
199
  | HHV | Find highest value in a preceding `periods` window |
@@ -163,6 +163,8 @@ Naming Rules:
163
163
  | BARSSINCE | Calculate number of bars since first condition true |
164
164
  | BETA | Rolling Beta coefficient of asset returns against benchmark returns. |
165
165
  | BINS | Discretize the input into n bins, the ctx.groups() is the number of groups |
166
+ | BW_SPLIT | Backward split and dividend adjustment |
167
+ | BW_SPLIT_FACTOR | Backward split factor calculation |
166
168
  | CC_RANK | Calculate rank percentage cross group dimension, the ctx.groups() is the number of groups Same value are averaged |
167
169
  | CC_ZSCORE | Calculate cross-sectional Z-Score across groups at each time step |
168
170
  | CORR | Time Series Correlation in moving window on self |
@@ -175,6 +177,8 @@ Naming Rules:
175
177
  | EMA | Exponential Moving Average (variant of well-known EMA) weight = 2 / (n + 1) |
176
178
  | ENTROPY | Calculate rolling Shannon entropy over a moving window |
177
179
  | FRET | Future Return |
180
+ | FW_SPLIT | Forward split and dividend adjustment |
181
+ | FW_SPLIT_FACTOR | Forward split factor calculation |
178
182
  | GROUP_RANK | Calculate rank percentage within each category group at each time step |
179
183
  | GROUP_ZSCORE | Calculate Z-Score within each category group at each time step |
180
184
  | HHV | Find highest value in a preceding `periods` window |