Skip to content

Commit e5147d8

Browse files
committed
prepare 0.42.0 release
1 parent b3dc6b8 commit e5147d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+18984
-4077
lines changed

absbox/local/china.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ def json(self):
7272
"triggers": renameKs2({k: {_k: mkTrigger(_v) for (_k,_v) in v.items()} for (k,v) in self.触发事件.items() },chinaDealCycle) if self.触发事件 else None,
7373
"liqProvider": {ln: mkLiqProvider(ln, lo | {"起始日":defaultStartDate} )
7474
for ln,lo in self.流动性支持.items() } if self.流动性支持 else None,
75-
"ledgers": {ln: mkLedger(ln, v) for ln,v in self.科目.items()} if self.科目 else None
75+
"ledgers": {ln: mkLedger(ln, v) for ln,v in self.科目.items()} if self.科目 else None,
76+
"stats": [{},{},{},{}]
7677
}
7778
_dealType = identify_deal_type(_r)
7879

absbox/local/component.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,16 @@ def mkDs(x):
435435
return mkTag(("AvgRatio", [mkDs(_) for _ in ds]))
436436
case ("amountForTargetIrr", irr, bn):
437437
return mkTag(("AmountRequiredForTargetIRR", [irr, bn]))
438+
case ("dealStat", _t, s):
439+
match _t :
440+
case "int":
441+
return mkTag(("DealStatInt", s))
442+
case "float" | "double" | "balance":
443+
return mkTag(("DealStatBalance", s))
444+
case "bool":
445+
return mkTag(("DealStatBool", s))
446+
case "rate" | "ratio" | "percent":
447+
return mkTag(("DealStatRate", s))
438448
case _:
439449
raise RuntimeError(f"Failed to match DS/Formula: {x}")
440450
except TypeError as e:
@@ -585,7 +595,7 @@ def mkBondType(x):
585595
case {"固定摊还": schedule} | {"PAC": schedule}:
586596
return mkTag(("PAC", mkTag(("BalanceCurve", schedule))))
587597
case {"BalanceByPeriod": bals}:
588-
return mkTag(("AmtByPeriod", mkTag(("WithTrailVal", bals))))
598+
return mkTag(("AmtByPeriod", mkTag(("CurrentVal", bals))))
589599
case {"过手摊还": None} | {"Sequential": None} | "Sequential" | "过手摊还":
590600
return mkTag(("Sequential"))
591601
case {"锁定摊还": _after} | {"Lockout": _after}:
@@ -643,9 +653,9 @@ def mkBondRate(x:dict)->dict:
643653
def mkStepUp(x):
644654
match x:
645655
case ("ladder", d, spd, dp):
646-
return mkTag(("PassDateLadderSpread", [d, vNum(spd), mkDatePattern(dp)]))
656+
return mkTag(("PassDateLadderSpread", [vDate(d), vNum(spd), mkDatePattern(dp)]))
647657
case ("once", d, spd):
648-
return mkTag(("PassDateSpread", [d, vNum(spd)]))
658+
return mkTag(("PassDateSpread", [vDate(d), vNum(spd)]))
649659
case _:
650660
raise RuntimeError(f"Failed to match bond step up type:{x}")
651661

@@ -696,7 +706,7 @@ def mkBnd(bn, x:dict):
696706
dueInt = getValWithKs(x, ["应付利息", "dueInt"], defaultReturn=0)
697707
duePrin = getValWithKs(x, ["应付本金", "duePrin"], defaultReturn=0)
698708
dueIntOverInt = getValWithKs(x, ["拖欠利息", "dueIntOverInt"], defaultReturn=0)
699-
mSt = getValWithKs(x, ["调息", "stepUp"], defaultReturn=None)
709+
mSt = getValWithKs(x, ["调息", "stepUp"], defaultReturn=None, mapping=mkStepUp)
700710
mTxns = getValWithKs(x, ["stmt", ], defaultReturn=None)
701711
# mStmt = mkTag(("Statement", mkTxn("bond", mTxns))) if mTxns else None
702712
mStmt = mkTxn("bond", mTxns) if mTxns else None

absbox/tests/benchmark/china/out/test01.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,12 @@
254254
"custom": null,
255255
"triggers": null,
256256
"liqProvider": null,
257-
"ledgers": null
257+
"ledgers": null,
258+
"stats": [
259+
{},
260+
{},
261+
{},
262+
{}
263+
]
258264
}
259265
}

absbox/tests/benchmark/china/out/test02.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@
248248
"custom": null,
249249
"triggers": null,
250250
"liqProvider": null,
251-
"ledgers": null
251+
"ledgers": null,
252+
"stats": [
253+
{},
254+
{},
255+
{},
256+
{}
257+
]
252258
}
253259
}

absbox/tests/benchmark/china/out/test03.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,12 @@
287287
"custom": null,
288288
"triggers": null,
289289
"liqProvider": null,
290-
"ledgers": null
290+
"ledgers": null,
291+
"stats": [
292+
{},
293+
{},
294+
{},
295+
{}
296+
]
291297
}
292298
}

absbox/tests/benchmark/china/out/test04.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,12 @@
464464
"custom": null,
465465
"triggers": null,
466466
"liqProvider": null,
467-
"ledgers": null
467+
"ledgers": null,
468+
"stats": [
469+
{},
470+
{},
471+
{},
472+
{}
473+
]
468474
}
469475
}

absbox/tests/benchmark/china/out/test05.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,11 @@
199199
"maturityDate": null
200200
},
201201
"bndInterestInfo": {
202-
"tag": "InterestByYield",
203-
"contents": 0.02
202+
"tag": "Fix",
203+
"contents": [
204+
0.02,
205+
"DC_ACT_365F"
206+
]
204207
},
205208
"bndType": {
206209
"tag": "Equity"
@@ -462,6 +465,12 @@
462465
"custom": null,
463466
"triggers": null,
464467
"liqProvider": null,
465-
"ledgers": null
468+
"ledgers": null,
469+
"stats": [
470+
{},
471+
{},
472+
{},
473+
{}
474+
]
466475
}
467476
}

absbox/tests/benchmark/china/out/test06.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,12 @@
515515
"custom": null,
516516
"triggers": null,
517517
"liqProvider": null,
518-
"ledgers": null
518+
"ledgers": null,
519+
"stats": [
520+
{},
521+
{},
522+
{},
523+
{}
524+
]
519525
}
520526
}

absbox/tests/benchmark/china/out/test07.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,12 @@
10711071
"custom": null,
10721072
"triggers": null,
10731073
"liqProvider": null,
1074-
"ledgers": null
1074+
"ledgers": null,
1075+
"stats": [
1076+
{},
1077+
{},
1078+
{},
1079+
{}
1080+
]
10751081
}
10761082
}

absbox/tests/benchmark/china/out/test08.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,6 +1347,12 @@
13471347
"custom": null,
13481348
"triggers": null,
13491349
"liqProvider": null,
1350-
"ledgers": null
1350+
"ledgers": null,
1351+
"stats": [
1352+
{},
1353+
{},
1354+
{},
1355+
{}
1356+
]
13511357
}
13521358
}

0 commit comments

Comments
 (0)