tea-bond 0.3.12__cp38-abi3-manylinux_2_28_x86_64.whl → 0.3.13__cp38-abi3-manylinux_2_28_x86_64.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.

Potentially problematic release.


This version of tea-bond might be problematic. Click here for more details.

pybond/pd.py CHANGED
@@ -291,6 +291,12 @@ class TfEvaluators:
291
291
  "last_trading_date"
292
292
  ].to_pandas()
293
293
 
294
+ @property
295
+ def remain_year(self):
296
+ return self.pl_df.select(remain_year=self._evaluators.remain_year)[
297
+ "remain_year"
298
+ ].to_pandas()
299
+
294
300
 
295
301
  class Bonds:
296
302
  """
@@ -387,6 +393,12 @@ class Bonds:
387
393
  "remain_cp_num"
388
394
  ].to_pandas()
389
395
 
396
+ def remain_year(self, date: str | pd.Series):
397
+ df = pl.DataFrame({"bond": self.bond, "date": date})
398
+ return df.select(remain_year=PlBonds("bond").remain_year("date"))[
399
+ "remain_year"
400
+ ].to_pandas()
401
+
390
402
 
391
403
  class Futures:
392
404
  def __init__(self, future: str | pd.Series):
pybond/pl.py CHANGED
@@ -269,6 +269,19 @@ class TfEvaluators:
269
269
  """
270
270
  return self._call_plugin("evaluators_last_trading_date")
271
271
 
272
+ @property
273
+ def remain_year(self):
274
+ """
275
+ Calculate bond remaining year (债券剩余期限).
276
+
277
+ Args:
278
+ date: Evaluation date column expression
279
+
280
+ Returns:
281
+ Polars expression for bond remaining year
282
+ """
283
+ return self._call_plugin("evaluators_remain_year")
284
+
272
285
 
273
286
  class Bonds:
274
287
  """
@@ -310,6 +323,12 @@ class Bonds:
310
323
  reinvest_rate=None,
311
324
  )
312
325
 
326
+ def remain_year(self, date: IntoExpr = "date"):
327
+ """
328
+ Calculate remain year for the bond (剩余期限).
329
+ """
330
+ return self._evaluator(date=date).remain_year
331
+
313
332
  def accrued_interest(self, date: IntoExpr = "date"):
314
333
  """
315
334
  Calculate accrued interest for the bond (应计利息).
pybond/pybond.abi3.so CHANGED
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tea-bond
3
- Version: 0.3.12
3
+ Version: 0.3.13
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -17,12 +17,12 @@ pybond/nb/nb_datetime.py,sha256=9fLD9rnfpHQ-cvX4H6PoFh_O3jgk475ZKrG8q_UxT34,1026
17
17
  pybond/nb/nb_duration.py,sha256=FSX1y2JbHB_SJn-hcVe-7Zf2v0xpQKKZ1MfWBY7d7IQ,1639
18
18
  pybond/nb/nb_evaluators.py,sha256=fCYxcvW717_1E4qY9AV8R5Pv8eTvWqKk3Zj-zMU1kiw,14987
19
19
  pybond/nb/nb_time.py,sha256=LaqXfcNvmYD_lZ2u108MwrxCXoVCBX3cr3oOnPp3c1g,8649
20
- pybond/pd.py,sha256=nqOEm0yw-2pRpx-3sut3zrYptdeZYYDKKk1bw6crIt0,13359
21
- pybond/pl.py,sha256=eXu_rcggdBKXLuzyLj65StIw45Jfu44EmTNi06WOBbo,13486
20
+ pybond/pd.py,sha256=3m6rpBW5-E2mG967Fb_hF4FjGoSXUQz0kBev9X104f8,13760
21
+ pybond/pl.py,sha256=YWUm-u6wpwEIU6cJOZW0NuC13gVu_rKd-JgQX0NeXGI,14000
22
22
  pybond/pnl.py,sha256=upJxtjJyD00eKKJsz7CR6ONXm6UeqCE3AIODZGDE2wQ,3465
23
23
  pybond/polars_utils.py,sha256=u14yoK9Qx4TC2oPq-zVk7d1XOLY8nGc1H8Nf9jt0R6c,2599
24
- pybond/pybond.abi3.so,sha256=tCxKye6LEQSC9jRqcc6AEJdld64Sv2mgQ8ZuG9mt8yE,30544273
24
+ pybond/pybond.abi3.so,sha256=ycu0J5DMRIIT1QbkgYcFZDeDEX6eVfRTHaaqV706zrk,30687713
25
25
  pybond/pybond.pyi,sha256=xME119HJzVNqNCJ9FapVaQg1amxbNHlbd-qfFyiuhL4,11230
26
- tea_bond-0.3.12.dist-info/METADATA,sha256=LZOQ6O98UhsurMn3R23Kvk5klAjsDmqmo6xabz8cnzc,258
27
- tea_bond-0.3.12.dist-info/WHEEL,sha256=aOjTN5bAUkIqIK1JFnJz3vA_KyYjKKgPFflJ6PJ2YX0,106
28
- tea_bond-0.3.12.dist-info/RECORD,,
26
+ tea_bond-0.3.13.dist-info/METADATA,sha256=oeiGcz6LjIS_hxzxSp2M_7D7N48y7Vt3mes1eOvRq6I,258
27
+ tea_bond-0.3.13.dist-info/WHEEL,sha256=aOjTN5bAUkIqIK1JFnJz3vA_KyYjKKgPFflJ6PJ2YX0,106
28
+ tea_bond-0.3.13.dist-info/RECORD,,