hkjc 0.3.1__py3-none-any.whl → 0.3.3__py3-none-any.whl

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.
hkjc/harville_model.py CHANGED
@@ -104,7 +104,8 @@ def _extract_pair_in_top_k(dp: np.ndarray, n: int, k: int) -> np.ndarray:
104
104
 
105
105
  for i in range(k):
106
106
  for j in range(k):
107
- M[horses[i], horses[j]] += prob
107
+ if horses[i] != horses[j]:
108
+ M[horses[i], horses[j]] += prob
108
109
 
109
110
  return M
110
111
 
hkjc/processing.py CHANGED
@@ -48,11 +48,12 @@ def generate_all_qp_trades(date: str, venue_code: str, race_number: int, rebate:
48
48
 
49
49
  if harville_fit:
50
50
  ho = HarvilleOptimizer(N)
51
- fit_res = ho.fit(1/odds['WIN'], 1/odds['QIN'],
52
- 1/odds['QPL'], 1/odds['PLA'])
51
+ prob = {k: np.nan_to_num(1/v, 0) for k,v in odds.items()}
52
+ fit_res = ho.fit(prob['WIN'], prob['QIN'],
53
+ prob['QPL'], prob['PLA'])
53
54
  if fit_res['success']:
54
- odds['PLA'] = 1/fit_res['b_fitted']
55
- odds['QPL'] = 1/fit_res['Q_fitted']
55
+ odds['PLA'] = np.nan_to_num(1/fit_res['b_fitted'], posinf=0)
56
+ odds['QPL'] = np.nan_to_num(1/fit_res['Q_fitted'], posinf=0)
56
57
 
57
58
  results = [_process_single_qp_trade(banker, covered, odds['PLA'], odds['QPL'], rebate)
58
59
  for banker in tqdm(candidates, desc="Processing bankers")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hkjc
3
- Version: 0.3.1
3
+ Version: 0.3.3
4
4
  Summary: Library for scrapping HKJC data and perform basic analysis
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: cachetools>=6.2.0
@@ -1,13 +1,13 @@
1
1
  hkjc/__init__.py,sha256=KBbWVwLXPPb93bk_h2Qt9t5OH8y6RrVUeH-ZYNKQAoQ,619
2
2
  hkjc/analysis.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- hkjc/harville_model.py,sha256=Kn9IeiaWBxDcbzZIGd3B6DAIA8MTaQuC5qBj-cSJfMM,12752
3
+ hkjc/harville_model.py,sha256=KoN5AxaAbjDkCCFUrTBSdsfZDkcINrCku9JHguofMHU,12799
4
4
  hkjc/live_odds.py,sha256=i_g9ckQKA9GWbwPXNvbmNvm-dPbF9UJoGiWv6_bHzwA,4603
5
5
  hkjc/optimization.py,sha256=OArQ3w9bwcIV_lTNuE5za6AROoa90xk_gwAoGwQ-8RE,3784
6
- hkjc/processing.py,sha256=WLjIF-p7hX4aVJkhTuVebEdawxNcaP9eEOTvVXLz7i4,3480
6
+ hkjc/processing.py,sha256=nf62eQjoKAxlgcLWw8e1tKSBeKtynIDRSyC5IDU22ws,3588
7
7
  hkjc/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  hkjc/qpbanker.py,sha256=vhvYb5_nGrKgYgre9gGF6tgswovca5C9pZVOPGxEP1Q,4804
9
9
  hkjc/speedpro.py,sha256=vKnSz9yY1rfVmRo7GVxXLjsiQN-YgwxSbV0B7yuszS4,1702
10
10
  hkjc/visualization.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- hkjc-0.3.1.dist-info/METADATA,sha256=yn9N5730YazXG0HrUTWth92pbbwDjVdq_p_5Y4MnYAY,413
12
- hkjc-0.3.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
13
- hkjc-0.3.1.dist-info/RECORD,,
11
+ hkjc-0.3.3.dist-info/METADATA,sha256=SaBXPx16MxqrYiDaHdNrURTcagUjZBOkHPkDGng_DVY,413
12
+ hkjc-0.3.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
13
+ hkjc-0.3.3.dist-info/RECORD,,
File without changes