betaquant 0.6.3__tar.gz → 0.6.4__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 (82) hide show
  1. {betaquant-0.6.3 → betaquant-0.6.4}/Cargo.lock +485 -1
  2. {betaquant-0.6.3 → betaquant-0.6.4}/Cargo.toml +2 -1
  3. {betaquant-0.6.3 → betaquant-0.6.4}/PKG-INFO +1 -1
  4. betaquant-0.6.4/examples/demo_license.key +1 -0
  5. betaquant-0.6.4/examples/demo_license.py +44 -0
  6. {betaquant-0.6.3 → betaquant-0.6.4}/examples/gtja191/main.py +6 -1
  7. {betaquant-0.6.3 → betaquant-0.6.4}/examples/quickstart/full_demo.py +7 -1
  8. {betaquant-0.6.3 → betaquant-0.6.4}/examples/quickstart/rank.py +8 -1
  9. {betaquant-0.6.3 → betaquant-0.6.4}/examples/quickstart/usage.py +8 -1
  10. {betaquant-0.6.3 → betaquant-0.6.4}/examples/quickstart/verify_sumif.py +6 -1
  11. {betaquant-0.6.3 → betaquant-0.6.4}/examples/wq101/main.py +6 -1
  12. {betaquant-0.6.3 → betaquant-0.6.4}/src/lib.rs +20 -9
  13. {betaquant-0.6.3 → betaquant-0.6.4}/src/license.rs +130 -8
  14. {betaquant-0.6.3 → betaquant-0.6.4}/.gitea/builder/Dockerfile +0 -0
  15. {betaquant-0.6.3 → betaquant-0.6.4}/.gitea/builder/README.md +0 -0
  16. {betaquant-0.6.3 → betaquant-0.6.4}/.gitea/workflows/publish.yml +0 -0
  17. {betaquant-0.6.3 → betaquant-0.6.4}/.gitignore +0 -0
  18. {betaquant-0.6.3 → betaquant-0.6.4}/CHANGELOG.md +0 -0
  19. {betaquant-0.6.3 → betaquant-0.6.4}/LICENSE +0 -0
  20. {betaquant-0.6.3 → betaquant-0.6.4}/README.md +0 -0
  21. {betaquant-0.6.3 → betaquant-0.6.4}/build.rs +0 -0
  22. {betaquant-0.6.3 → betaquant-0.6.4}/examples/gtja191/al/__init__.py +0 -0
  23. {betaquant-0.6.3 → betaquant-0.6.4}/examples/gtja191/al/alpha191.py +0 -0
  24. {betaquant-0.6.3 → betaquant-0.6.4}/examples/gtja191/al/alpha191_context.py +0 -0
  25. {betaquant-0.6.3 → betaquant-0.6.4}/examples/gtja191/alpha191.txt +0 -0
  26. {betaquant-0.6.3 → betaquant-0.6.4}/examples/wq101/al/__init__.py +0 -0
  27. {betaquant-0.6.3 → betaquant-0.6.4}/examples/wq101/al/alpha101.py +0 -0
  28. {betaquant-0.6.3 → betaquant-0.6.4}/examples/wq101/al/alpha101_context.py +0 -0
  29. {betaquant-0.6.3 → betaquant-0.6.4}/examples/wq101/alpha101.txt +0 -0
  30. {betaquant-0.6.3 → betaquant-0.6.4}/pyproject.toml +0 -0
  31. {betaquant-0.6.3 → betaquant-0.6.4}/python/betaquant/__init__.py +0 -0
  32. {betaquant-0.6.3 → betaquant-0.6.4}/python/betaquant/algo/__init__.py +0 -0
  33. {betaquant-0.6.3 → betaquant-0.6.4}/python/betaquant/algo/algo_gen.py +0 -0
  34. {betaquant-0.6.3 → betaquant-0.6.4}/python/betaquant/algo/manual.py +0 -0
  35. {betaquant-0.6.3 → betaquant-0.6.4}/python/betaquant/algo.md +0 -0
  36. {betaquant-0.6.3 → betaquant-0.6.4}/python/betaquant/context.py +0 -0
  37. {betaquant-0.6.3 → betaquant-0.6.4}/python/betaquant/lang/__init__.py +0 -0
  38. {betaquant-0.6.3 → betaquant-0.6.4}/python/betaquant/lang/__main__.py +0 -0
  39. {betaquant-0.6.3 → betaquant-0.6.4}/python/betaquant/lang/alpha.lark +0 -0
  40. {betaquant-0.6.3 → betaquant-0.6.4}/python/betaquant/lang/parser.py +0 -0
  41. {betaquant-0.6.3 → betaquant-0.6.4}/python/betaquant/lang/to_python.py +0 -0
  42. {betaquant-0.6.3 → betaquant-0.6.4}/python/betaquant/perf.py +0 -0
  43. {betaquant-0.6.3 → betaquant-0.6.4}/python/betaquant/transforms.py +0 -0
  44. {betaquant-0.6.3 → betaquant-0.6.4}/python/tests/test_grammar.py +0 -0
  45. {betaquant-0.6.3 → betaquant-0.6.4}/python/tests/test_rank.py +0 -0
  46. {betaquant-0.6.3 → betaquant-0.6.4}/python/tests/test_to_python.py +0 -0
  47. {betaquant-0.6.3 → betaquant-0.6.4}/rustfmt.toml +0 -0
  48. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/alpha.rs +0 -0
  49. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/backfill.rs +0 -0
  50. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/context.rs +0 -0
  51. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/cross.rs +0 -0
  52. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/cut.rs +0 -0
  53. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/drawdown.rs +0 -0
  54. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/ema.rs +0 -0
  55. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/entropy.rs +0 -0
  56. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/error.rs +0 -0
  57. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/extremum.rs +0 -0
  58. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/group.rs +0 -0
  59. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/internal.rs +0 -0
  60. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/ma.rs +0 -0
  61. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/misc.rs +0 -0
  62. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/mod.rs +0 -0
  63. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/moments.rs +0 -0
  64. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/neutralize.rs +0 -0
  65. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/quantile.rs +0 -0
  66. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/rank.rs +0 -0
  67. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/returns.rs +0 -0
  68. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/rolling.rs +0 -0
  69. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/series.rs +0 -0
  70. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/sharpe.rs +0 -0
  71. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/slope.rs +0 -0
  72. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/spec.rs +0 -0
  73. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/split.rs +0 -0
  74. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/stats.rs +0 -0
  75. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/stddev.rs +0 -0
  76. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/sum.rs +0 -0
  77. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/topk.rs +0 -0
  78. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/wsum.rs +0 -0
  79. {betaquant-0.6.3 → betaquant-0.6.4}/src/algo/zscore.rs +0 -0
  80. {betaquant-0.6.3 → betaquant-0.6.4}/src/license/public_key.bin +0 -0
  81. {betaquant-0.6.3 → betaquant-0.6.4}/src//347/256/227/345/255/220/350/247/204/345/210/231/345/277/205/350/257/273.md" +0 -0
  82. {betaquant-0.6.3 → betaquant-0.6.4}/tag_release.py +0 -0
@@ -2,6 +2,12 @@
2
2
  # It is not intended for manual editing.
3
3
  version = 4
4
4
 
5
+ [[package]]
6
+ name = "adler2"
7
+ version = "2.0.1"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
10
+
5
11
  [[package]]
6
12
  name = "anyhow"
7
13
  version = "1.0.100"
@@ -37,7 +43,7 @@ checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06"
37
43
 
38
44
  [[package]]
39
45
  name = "betaquant"
40
- version = "0.6.3"
46
+ version = "0.6.4"
41
47
  dependencies = [
42
48
  "anyhow",
43
49
  "base64",
@@ -52,6 +58,7 @@ dependencies = [
52
58
  "serde_json",
53
59
  "sha2",
54
60
  "thiserror",
61
+ "ureq",
55
62
  ]
56
63
 
57
64
  [[package]]
@@ -94,6 +101,15 @@ dependencies = [
94
101
  "libc",
95
102
  ]
96
103
 
104
+ [[package]]
105
+ name = "crc32fast"
106
+ version = "1.5.0"
107
+ source = "registry+https://github.com/rust-lang/crates.io-index"
108
+ checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511"
109
+ dependencies = [
110
+ "cfg-if",
111
+ ]
112
+
97
113
  [[package]]
98
114
  name = "crossbeam-deque"
99
115
  version = "0.8.6"
@@ -176,6 +192,17 @@ dependencies = [
176
192
  "crypto-common",
177
193
  ]
178
194
 
195
+ [[package]]
196
+ name = "displaydoc"
197
+ version = "0.2.6"
198
+ source = "registry+https://github.com/rust-lang/crates.io-index"
199
+ checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f"
200
+ dependencies = [
201
+ "proc-macro2",
202
+ "quote",
203
+ "syn",
204
+ ]
205
+
179
206
  [[package]]
180
207
  name = "ed25519"
181
208
  version = "2.2.3"
@@ -218,6 +245,25 @@ version = "0.1.9"
218
245
  source = "registry+https://github.com/rust-lang/crates.io-index"
219
246
  checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
220
247
 
248
+ [[package]]
249
+ name = "flate2"
250
+ version = "1.1.9"
251
+ source = "registry+https://github.com/rust-lang/crates.io-index"
252
+ checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c"
253
+ dependencies = [
254
+ "crc32fast",
255
+ "miniz_oxide",
256
+ ]
257
+
258
+ [[package]]
259
+ name = "form_urlencoded"
260
+ version = "1.2.2"
261
+ source = "registry+https://github.com/rust-lang/crates.io-index"
262
+ checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
263
+ dependencies = [
264
+ "percent-encoding",
265
+ ]
266
+
221
267
  [[package]]
222
268
  name = "generic-array"
223
269
  version = "0.14.7"
@@ -245,6 +291,109 @@ version = "0.5.0"
245
291
  source = "registry+https://github.com/rust-lang/crates.io-index"
246
292
  checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
247
293
 
294
+ [[package]]
295
+ name = "icu_collections"
296
+ version = "2.2.0"
297
+ source = "registry+https://github.com/rust-lang/crates.io-index"
298
+ checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c"
299
+ dependencies = [
300
+ "displaydoc",
301
+ "potential_utf",
302
+ "utf8_iter",
303
+ "yoke",
304
+ "zerofrom",
305
+ "zerovec",
306
+ ]
307
+
308
+ [[package]]
309
+ name = "icu_locale_core"
310
+ version = "2.2.0"
311
+ source = "registry+https://github.com/rust-lang/crates.io-index"
312
+ checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29"
313
+ dependencies = [
314
+ "displaydoc",
315
+ "litemap",
316
+ "tinystr",
317
+ "writeable",
318
+ "zerovec",
319
+ ]
320
+
321
+ [[package]]
322
+ name = "icu_normalizer"
323
+ version = "2.2.0"
324
+ source = "registry+https://github.com/rust-lang/crates.io-index"
325
+ checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4"
326
+ dependencies = [
327
+ "icu_collections",
328
+ "icu_normalizer_data",
329
+ "icu_properties",
330
+ "icu_provider",
331
+ "smallvec",
332
+ "zerovec",
333
+ ]
334
+
335
+ [[package]]
336
+ name = "icu_normalizer_data"
337
+ version = "2.2.0"
338
+ source = "registry+https://github.com/rust-lang/crates.io-index"
339
+ checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38"
340
+
341
+ [[package]]
342
+ name = "icu_properties"
343
+ version = "2.2.0"
344
+ source = "registry+https://github.com/rust-lang/crates.io-index"
345
+ checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de"
346
+ dependencies = [
347
+ "icu_collections",
348
+ "icu_locale_core",
349
+ "icu_properties_data",
350
+ "icu_provider",
351
+ "zerotrie",
352
+ "zerovec",
353
+ ]
354
+
355
+ [[package]]
356
+ name = "icu_properties_data"
357
+ version = "2.2.0"
358
+ source = "registry+https://github.com/rust-lang/crates.io-index"
359
+ checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14"
360
+
361
+ [[package]]
362
+ name = "icu_provider"
363
+ version = "2.2.0"
364
+ source = "registry+https://github.com/rust-lang/crates.io-index"
365
+ checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421"
366
+ dependencies = [
367
+ "displaydoc",
368
+ "icu_locale_core",
369
+ "writeable",
370
+ "yoke",
371
+ "zerofrom",
372
+ "zerotrie",
373
+ "zerovec",
374
+ ]
375
+
376
+ [[package]]
377
+ name = "idna"
378
+ version = "1.1.0"
379
+ source = "registry+https://github.com/rust-lang/crates.io-index"
380
+ checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"
381
+ dependencies = [
382
+ "idna_adapter",
383
+ "smallvec",
384
+ "utf8_iter",
385
+ ]
386
+
387
+ [[package]]
388
+ name = "idna_adapter"
389
+ version = "1.2.2"
390
+ source = "registry+https://github.com/rust-lang/crates.io-index"
391
+ checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714"
392
+ dependencies = [
393
+ "icu_normalizer",
394
+ "icu_properties",
395
+ ]
396
+
248
397
  [[package]]
249
398
  name = "itoa"
250
399
  version = "1.0.18"
@@ -257,6 +406,12 @@ version = "0.2.180"
257
406
  source = "registry+https://github.com/rust-lang/crates.io-index"
258
407
  checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
259
408
 
409
+ [[package]]
410
+ name = "litemap"
411
+ version = "0.8.2"
412
+ source = "registry+https://github.com/rust-lang/crates.io-index"
413
+ checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"
414
+
260
415
  [[package]]
261
416
  name = "log"
262
417
  version = "0.4.29"
@@ -279,6 +434,16 @@ version = "2.8.1"
279
434
  source = "registry+https://github.com/rust-lang/crates.io-index"
280
435
  checksum = "6b947ae49db0d222b1dbc6b113ce7248a3fc3a6ca21b696717bfc000ba4484d8"
281
436
 
437
+ [[package]]
438
+ name = "miniz_oxide"
439
+ version = "0.8.9"
440
+ source = "registry+https://github.com/rust-lang/crates.io-index"
441
+ checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
442
+ dependencies = [
443
+ "adler2",
444
+ "simd-adler32",
445
+ ]
446
+
282
447
  [[package]]
283
448
  name = "ndarray"
284
449
  version = "0.17.2"
@@ -343,6 +508,12 @@ version = "1.21.3"
343
508
  source = "registry+https://github.com/rust-lang/crates.io-index"
344
509
  checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
345
510
 
511
+ [[package]]
512
+ name = "percent-encoding"
513
+ version = "2.3.2"
514
+ source = "registry+https://github.com/rust-lang/crates.io-index"
515
+ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
516
+
346
517
  [[package]]
347
518
  name = "pkcs8"
348
519
  version = "0.10.2"
@@ -368,6 +539,15 @@ dependencies = [
368
539
  "portable-atomic",
369
540
  ]
370
541
 
542
+ [[package]]
543
+ name = "potential_utf"
544
+ version = "0.1.5"
545
+ source = "registry+https://github.com/rust-lang/crates.io-index"
546
+ checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564"
547
+ dependencies = [
548
+ "zerovec",
549
+ ]
550
+
371
551
  [[package]]
372
552
  name = "proc-macro2"
373
553
  version = "1.0.106"
@@ -500,6 +680,20 @@ dependencies = [
500
680
  "crossbeam-utils",
501
681
  ]
502
682
 
683
+ [[package]]
684
+ name = "ring"
685
+ version = "0.17.14"
686
+ source = "registry+https://github.com/rust-lang/crates.io-index"
687
+ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
688
+ dependencies = [
689
+ "cc",
690
+ "cfg-if",
691
+ "getrandom",
692
+ "libc",
693
+ "untrusted",
694
+ "windows-sys",
695
+ ]
696
+
503
697
  [[package]]
504
698
  name = "rustc-hash"
505
699
  version = "2.1.1"
@@ -515,6 +709,41 @@ dependencies = [
515
709
  "semver",
516
710
  ]
517
711
 
712
+ [[package]]
713
+ name = "rustls"
714
+ version = "0.23.40"
715
+ source = "registry+https://github.com/rust-lang/crates.io-index"
716
+ checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b"
717
+ dependencies = [
718
+ "log",
719
+ "once_cell",
720
+ "ring",
721
+ "rustls-pki-types",
722
+ "rustls-webpki",
723
+ "subtle",
724
+ "zeroize",
725
+ ]
726
+
727
+ [[package]]
728
+ name = "rustls-pki-types"
729
+ version = "1.14.1"
730
+ source = "registry+https://github.com/rust-lang/crates.io-index"
731
+ checksum = "30a7197ae7eb376e574fe940d068c30fe0462554a3ddbe4eca7838e049c937a9"
732
+ dependencies = [
733
+ "zeroize",
734
+ ]
735
+
736
+ [[package]]
737
+ name = "rustls-webpki"
738
+ version = "0.103.13"
739
+ source = "registry+https://github.com/rust-lang/crates.io-index"
740
+ checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e"
741
+ dependencies = [
742
+ "ring",
743
+ "rustls-pki-types",
744
+ "untrusted",
745
+ ]
746
+
518
747
  [[package]]
519
748
  name = "rustversion"
520
749
  version = "1.0.22"
@@ -596,6 +825,18 @@ dependencies = [
596
825
  "rand_core",
597
826
  ]
598
827
 
828
+ [[package]]
829
+ name = "simd-adler32"
830
+ version = "0.3.9"
831
+ source = "registry+https://github.com/rust-lang/crates.io-index"
832
+ checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214"
833
+
834
+ [[package]]
835
+ name = "smallvec"
836
+ version = "1.15.1"
837
+ source = "registry+https://github.com/rust-lang/crates.io-index"
838
+ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
839
+
599
840
  [[package]]
600
841
  name = "spki"
601
842
  version = "0.7.3"
@@ -606,6 +847,12 @@ dependencies = [
606
847
  "der",
607
848
  ]
608
849
 
850
+ [[package]]
851
+ name = "stable_deref_trait"
852
+ version = "1.2.1"
853
+ source = "registry+https://github.com/rust-lang/crates.io-index"
854
+ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
855
+
609
856
  [[package]]
610
857
  name = "subtle"
611
858
  version = "2.6.1"
@@ -623,6 +870,17 @@ dependencies = [
623
870
  "unicode-ident",
624
871
  ]
625
872
 
873
+ [[package]]
874
+ name = "synstructure"
875
+ version = "0.13.2"
876
+ source = "registry+https://github.com/rust-lang/crates.io-index"
877
+ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
878
+ dependencies = [
879
+ "proc-macro2",
880
+ "quote",
881
+ "syn",
882
+ ]
883
+
626
884
  [[package]]
627
885
  name = "target-lexicon"
628
886
  version = "0.13.4"
@@ -649,6 +907,16 @@ dependencies = [
649
907
  "syn",
650
908
  ]
651
909
 
910
+ [[package]]
911
+ name = "tinystr"
912
+ version = "0.8.3"
913
+ source = "registry+https://github.com/rust-lang/crates.io-index"
914
+ checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d"
915
+ dependencies = [
916
+ "displaydoc",
917
+ "zerovec",
918
+ ]
919
+
652
920
  [[package]]
653
921
  name = "typenum"
654
922
  version = "1.20.1"
@@ -661,6 +929,48 @@ version = "1.0.22"
661
929
  source = "registry+https://github.com/rust-lang/crates.io-index"
662
930
  checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
663
931
 
932
+ [[package]]
933
+ name = "untrusted"
934
+ version = "0.9.0"
935
+ source = "registry+https://github.com/rust-lang/crates.io-index"
936
+ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
937
+
938
+ [[package]]
939
+ name = "ureq"
940
+ version = "2.12.1"
941
+ source = "registry+https://github.com/rust-lang/crates.io-index"
942
+ checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d"
943
+ dependencies = [
944
+ "base64",
945
+ "flate2",
946
+ "log",
947
+ "once_cell",
948
+ "rustls",
949
+ "rustls-pki-types",
950
+ "serde",
951
+ "serde_json",
952
+ "url",
953
+ "webpki-roots 0.26.11",
954
+ ]
955
+
956
+ [[package]]
957
+ name = "url"
958
+ version = "2.5.8"
959
+ source = "registry+https://github.com/rust-lang/crates.io-index"
960
+ checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"
961
+ dependencies = [
962
+ "form_urlencoded",
963
+ "idna",
964
+ "percent-encoding",
965
+ "serde",
966
+ ]
967
+
968
+ [[package]]
969
+ name = "utf8_iter"
970
+ version = "1.0.4"
971
+ source = "registry+https://github.com/rust-lang/crates.io-index"
972
+ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
973
+
664
974
  [[package]]
665
975
  name = "version_check"
666
976
  version = "0.9.5"
@@ -673,12 +983,186 @@ version = "0.11.1+wasi-snapshot-preview1"
673
983
  source = "registry+https://github.com/rust-lang/crates.io-index"
674
984
  checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
675
985
 
986
+ [[package]]
987
+ name = "webpki-roots"
988
+ version = "0.26.11"
989
+ source = "registry+https://github.com/rust-lang/crates.io-index"
990
+ checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9"
991
+ dependencies = [
992
+ "webpki-roots 1.0.7",
993
+ ]
994
+
995
+ [[package]]
996
+ name = "webpki-roots"
997
+ version = "1.0.7"
998
+ source = "registry+https://github.com/rust-lang/crates.io-index"
999
+ checksum = "52f5ee44c96cf55f1b349600768e3ece3a8f26010c05265ab73f945bb1a2eb9d"
1000
+ dependencies = [
1001
+ "rustls-pki-types",
1002
+ ]
1003
+
1004
+ [[package]]
1005
+ name = "windows-sys"
1006
+ version = "0.52.0"
1007
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1008
+ checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
1009
+ dependencies = [
1010
+ "windows-targets",
1011
+ ]
1012
+
1013
+ [[package]]
1014
+ name = "windows-targets"
1015
+ version = "0.52.6"
1016
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1017
+ checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
1018
+ dependencies = [
1019
+ "windows_aarch64_gnullvm",
1020
+ "windows_aarch64_msvc",
1021
+ "windows_i686_gnu",
1022
+ "windows_i686_gnullvm",
1023
+ "windows_i686_msvc",
1024
+ "windows_x86_64_gnu",
1025
+ "windows_x86_64_gnullvm",
1026
+ "windows_x86_64_msvc",
1027
+ ]
1028
+
1029
+ [[package]]
1030
+ name = "windows_aarch64_gnullvm"
1031
+ version = "0.52.6"
1032
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1033
+ checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
1034
+
1035
+ [[package]]
1036
+ name = "windows_aarch64_msvc"
1037
+ version = "0.52.6"
1038
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1039
+ checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
1040
+
1041
+ [[package]]
1042
+ name = "windows_i686_gnu"
1043
+ version = "0.52.6"
1044
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1045
+ checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
1046
+
1047
+ [[package]]
1048
+ name = "windows_i686_gnullvm"
1049
+ version = "0.52.6"
1050
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1051
+ checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
1052
+
1053
+ [[package]]
1054
+ name = "windows_i686_msvc"
1055
+ version = "0.52.6"
1056
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1057
+ checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
1058
+
1059
+ [[package]]
1060
+ name = "windows_x86_64_gnu"
1061
+ version = "0.52.6"
1062
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1063
+ checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
1064
+
1065
+ [[package]]
1066
+ name = "windows_x86_64_gnullvm"
1067
+ version = "0.52.6"
1068
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1069
+ checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
1070
+
1071
+ [[package]]
1072
+ name = "windows_x86_64_msvc"
1073
+ version = "0.52.6"
1074
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1075
+ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
1076
+
1077
+ [[package]]
1078
+ name = "writeable"
1079
+ version = "0.6.3"
1080
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1081
+ checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4"
1082
+
1083
+ [[package]]
1084
+ name = "yoke"
1085
+ version = "0.8.2"
1086
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1087
+ checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca"
1088
+ dependencies = [
1089
+ "stable_deref_trait",
1090
+ "yoke-derive",
1091
+ "zerofrom",
1092
+ ]
1093
+
1094
+ [[package]]
1095
+ name = "yoke-derive"
1096
+ version = "0.8.2"
1097
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1098
+ checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e"
1099
+ dependencies = [
1100
+ "proc-macro2",
1101
+ "quote",
1102
+ "syn",
1103
+ "synstructure",
1104
+ ]
1105
+
1106
+ [[package]]
1107
+ name = "zerofrom"
1108
+ version = "0.1.8"
1109
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1110
+ checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272"
1111
+ dependencies = [
1112
+ "zerofrom-derive",
1113
+ ]
1114
+
1115
+ [[package]]
1116
+ name = "zerofrom-derive"
1117
+ version = "0.1.7"
1118
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1119
+ checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1"
1120
+ dependencies = [
1121
+ "proc-macro2",
1122
+ "quote",
1123
+ "syn",
1124
+ "synstructure",
1125
+ ]
1126
+
676
1127
  [[package]]
677
1128
  name = "zeroize"
678
1129
  version = "1.8.2"
679
1130
  source = "registry+https://github.com/rust-lang/crates.io-index"
680
1131
  checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0"
681
1132
 
1133
+ [[package]]
1134
+ name = "zerotrie"
1135
+ version = "0.2.4"
1136
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1137
+ checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf"
1138
+ dependencies = [
1139
+ "displaydoc",
1140
+ "yoke",
1141
+ "zerofrom",
1142
+ ]
1143
+
1144
+ [[package]]
1145
+ name = "zerovec"
1146
+ version = "0.11.6"
1147
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1148
+ checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239"
1149
+ dependencies = [
1150
+ "yoke",
1151
+ "zerofrom",
1152
+ "zerovec-derive",
1153
+ ]
1154
+
1155
+ [[package]]
1156
+ name = "zerovec-derive"
1157
+ version = "0.11.3"
1158
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1159
+ checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555"
1160
+ dependencies = [
1161
+ "proc-macro2",
1162
+ "quote",
1163
+ "syn",
1164
+ ]
1165
+
682
1166
  [[package]]
683
1167
  name = "zmij"
684
1168
  version = "1.0.21"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "betaquant"
3
- version = "0.6.3"
3
+ version = "0.6.4"
4
4
  edition = "2024"
5
5
  authors = ["ZhaoJun"]
6
6
  readme = "README.md"
@@ -24,6 +24,7 @@ base64 = "0.22"
24
24
  serde = { version = "1", features = ["derive"] }
25
25
  serde_json = "1"
26
26
  sha2 = "0.10"
27
+ ureq = { version = "2", features = ["json", "tls"] }
27
28
 
28
29
 
29
30
  [build-dependencies]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: betaquant
3
- Version: 0.6.3
3
+ Version: 0.6.4
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -0,0 +1 @@
1
+ eyJhbGxvdyI6WyIqIl0sImRlbnkiOltdLCJleHAiOjQ5MzM5MDc1NjIsImlhdCI6MTc4MDMwNzU2Miwia2lkIjoidjEiLCJzdWIiOiJiZXRhcXVhbnQtZXhhbXBsZXMtZGVtbyJ9.apCmHKM0Ro8DQ7Dprbupbg8W8QquMrU9LDhI8W_QDbCImOg0huJpWqZzeyrNObBDeKZnyo921lN7H3JWFw5rCg
@@ -0,0 +1,44 @@
1
+ """示例专用的 license 引导。
2
+
3
+ betaquant 的算子受 license 硬门禁保护:调用任何 `ts_*` / `cc_*` 算子前,必须先
4
+ `betaquant.set_license_token(<有效 key>)`,否则算子直接抛 `ValueError`。
5
+
6
+ 本模块随仓库分发一把**通用 demo key**(`demo_license.key`:全算子放行 `allow=['*']`、
7
+ 不绑机器、超长有效期),供 examples 开箱即用。各 example 顶部加几行即可(examples 目录
8
+ 不是包,脚本方式运行,故用路径引导):
9
+
10
+ import os, sys
11
+ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
12
+ import demo_license # noqa: F401 (import 即启用)
13
+
14
+ 若已把 examples 目录加入 sys.path,也可显式调用:
15
+
16
+ import demo_license
17
+ demo_license.activate()
18
+
19
+ 注意:
20
+ * 这把 key 只用于跑示例,**不随 pip wheel 分发**(wheel 只含 python/betaquant),
21
+ 仅存在于源码仓库;生产环境请用自己的签发方按机器签发受限 key。
22
+ * key 全放行 + 不绑机器,没有任何保护意义,切勿用于生产。
23
+ """
24
+ from __future__ import annotations
25
+
26
+ from pathlib import Path
27
+
28
+ import betaquant
29
+
30
+ _KEY_FILE = Path(__file__).resolve().parent / "demo_license.key"
31
+
32
+
33
+ def load_key() -> str:
34
+ """读取随仓库分发的 demo license key 文本。"""
35
+ return _KEY_FILE.read_text(encoding="utf-8").strip()
36
+
37
+
38
+ def activate() -> None:
39
+ """启用 demo key:之后所有算子调用通过 Rust 硬门禁。"""
40
+ betaquant.set_license_token(load_key())
41
+
42
+
43
+ # import 即启用,方便 example 一行 `import examples.demo_license` 搞定
44
+ activate()
@@ -12,10 +12,15 @@
12
12
  from __future__ import annotations
13
13
 
14
14
  import logging
15
+ import os
16
+ import sys
15
17
  import time
16
18
 
17
19
  import betaquant
18
- betaquant.set_license_token('')
20
+
21
+ # 启用示例专用 demo license(算子受 Rust 硬门禁保护,必须先设 token)
22
+ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
23
+ import demo_license # noqa: E402,F401 (import 即启用)
19
24
 
20
25
  import numpy as np
21
26
  import pandas as pd