Skip to content

Commit

Permalink
24-May release
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowbean committed May 2, 2024
1 parent 62850e0 commit 56968b3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
8 changes: 6 additions & 2 deletions absbox/local/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ def mkDs(x):
return mkTag("CurrentBondBalance")
case ("债券余额", *bnds) | ("bondBalance", *bnds):
return mkTag(("CurrentBondBalanceOf", vList(bnds, str)))
case ("初始债券余额",) | ("originalBondBalance",):
case ("初始债券余额",*bnds) | ("originalBondBalance",*bnds):
if bnds:
return mkTag("OriginalBondBalanceOf", vList(bnds, str))
return mkTag("OriginalBondBalance")
case ("到期月份", bn) | ("monthsTillMaturity", bn):
return mkTag(("MonthsTillMaturity", vStr(bn)))
Expand Down Expand Up @@ -247,7 +249,7 @@ def mkDs(x):
case ("资产池系数", *pNames) | ("poolFactor", *pNames):
if pNames:
return mkTag(("PoolFactor", lmap(mkPid,pNames)))
return mkTag("PoolFactor")
return mkTag(("PoolFactor", None))
case ("债券利率", bn) | ("bondRate", bn):
return mkTag(("BondRate", vStr(bn)))
case ("债券加权利率", *bn) | ("bondWaRate", *bn):
Expand Down Expand Up @@ -306,6 +308,8 @@ def mkDs(x):
return mkTag(("AccTxnAmt", [ans, cmt]))
case ("系数", ds, f) | ("factor", ds, f) | ("*", ds, f) if isinstance(f, float):
return mkTag(("Factor", [mkDs(ds), f]))
case ("*", *ds):
return mkTag(("Multiply", lmap(mkDs, ds)))
case ("Min", *ds) | ("min", *ds):
return mkTag(("Min", lmap(mkDs, ds)))
case ("Max", *ds) | ("max", *ds):
Expand Down
8 changes: 8 additions & 0 deletions docs/source/howto.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1078,3 +1078,11 @@ A string
^^^^^^^^^^^^^^^

Now with that string, user can just write it into a No-SQL document database . or sent via Email , or Fax it .


How to use Deal JSON string
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The JSON string from `.json()` method can be used as part of post request send to `Hastructure` engine.

But unfortunately there is no way convert the string back to python class so far.
9 changes: 5 additions & 4 deletions docs/source/modeling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ Bond
* ``("bondBalance",)`` -> sum of all bond balance
* ``("bondBalance","A","B"...)`` -> sum of balance of bond A and bond B
* ``("originalBondBalance",)`` -> bond balance at issuance
* ``("originalBondBalance","A","B")`` -> bond balance at issuance of "A" and "B"
* ``("bondFactor",)`` -> bond factor
* ``("bondDueInt","A","B")`` -> bond due interest for bond A and bond B
* ``("lastBondIntPaid","A")`` -> bond last paid interest
Expand All @@ -226,10 +227,10 @@ Pool
* ``("cumPoolDefaultedBalance",)`` -> pool cumulative defaulted balance
* ``("cumPoolNetLoss",)`` -> pool cumulative pool net loss balance
* ``("cumPoolRecoveries",)`` -> pool cumulative recoveries
* ``("cumPoolCollection", <field1>,<field2>....)`` -> pool cumulative on <field...> fields :ref:`Pool Sources`
* ``("cumPoolCollectionTill", N,<field1>,<field2>....)`` -> pool cumulative on <field...> fields till Period N :ref:`Pool Sources`
* ``("curPoolCollection", <field1>,<field2>...)`` -> pool current sum of fields
* ``("curPoolCollectionTill", N,<field1>,<field2>...)`` -> pool current sum of fields till Period N
* ``("cumPoolCollection", None, <field1>,<field2>....)`` -> pool cumulative on <field...> fields :ref:`Pool Sources`
* ``("cumPoolCollectionTill", None, N,<field1>,<field2>....)`` -> pool cumulative on <field...> fields till Period N :ref:`Pool Sources`
* ``("curPoolCollection", None, <field1>,<field2>...)`` -> pool current sum of fields
* ``("curPoolCollectionTill", None, N,<field1>,<field2>...)`` -> pool current sum of fields till Period N

.. versionadded:: 0.24.1

Expand Down

0 comments on commit 56968b3

Please sign in to comment.