From b911386e4f1dc66e2c3d21c81e5455ffd682dff4 Mon Sep 17 00:00:00 2001 From: yellowbean Date: Thu, 12 Dec 2024 04:15:03 +0800 Subject: [PATCH] minor changes --- absbox/local/component.py | 5 ++--- absbox/report.py | 6 +++--- docs/source/modeling.rst | 14 +++++++------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/absbox/local/component.py b/absbox/local/component.py index 30a900b..6b626d9 100644 --- a/absbox/local/component.py +++ b/absbox/local/component.py @@ -1039,14 +1039,13 @@ def mkMod(y: dict) -> tuple: ### Revolving buy with all cash and source/target pool case ["购买资产2", liq, source, _limit, sPool, mPn] | ["buyAsset2", liq, source, _limit, sPool, mPn ]: return mkTag(("BuyAssetFrom", [mkLimit(_limit), mkLiqMethod(liq), vStr(source), sPool, mkPid(mPn)])) - ## Trigger case ["更新事件", trgName] | ["runTriggers", *trgName] | ["runTrigger", *trgName]: return mkTag(("RunTrigger", ["InWF", vList(trgName, str)])) ## Inspect case ["查看", comment, *ds] | ["inspect", comment, *ds]: - return mkTag(("WatchVal", [comment, lmap(mkDs, ds)])) - case ["更改状态", p, st] | ["changeStatus", p, st]: + return mkTag(("WatchVal", [vStr(comment), lmap(mkDs, ds)])) + case ["更改状态", p, st] | ["changeStatusIf", p, st]: return mkTag(("ChangeStatus",[mkPre(p), mkStatus(st)])) case ["更改状态", st] | ["changeStatus", st]: return mkTag(("ChangeStatus",[None, mkStatus(st)])) diff --git a/absbox/report.py b/absbox/report.py index ecbb61a..f48eada 100644 --- a/absbox/report.py +++ b/absbox/report.py @@ -28,11 +28,11 @@ def mapToList(m:dict, title_=h3, anchor=False): def buildSection(lst:list, title_=(h2,h3), anchor=False): return [ div[ title_[0](id=f"anchor-{_t}")[_t], mapToList(x, anchor=_t)] - for (_t, x) in lst] + for (_t, x) in lst] def buildSectionFlat(lst:list, title_=h2, anchor=False): return [ div[ title_(id=f"anchor-{_t}")[_t],Markup(x.to_html())] - for (_t, x) in lst if x is not None] + for (_t, x) in lst if x is not None] def toHtml(r:dict, p:str, style=OutputType.Plain, debug=False): """ @@ -43,7 +43,7 @@ def toHtml(r:dict, p:str, style=OutputType.Plain, debug=False): bondGrpDf = ("BondGroup", tz.pipe(tz.valfilter(lambda x: not isinstance(x, pd.DataFrame), r['bonds']) ,lambda x : {f"{k}-{k2}":v2 for k,v in x.items() - for k2,v2 in v.items()} + for k2,v2 in v.items()} ) ) diff --git a/docs/source/modeling.rst b/docs/source/modeling.rst index f77699c..69a58f7 100644 --- a/docs/source/modeling.rst +++ b/docs/source/modeling.rst @@ -2857,18 +2857,18 @@ There are two types of `Conditional Action`, which are same in with "IF" / "IF-E Change Deal Status ^^^^^^^^^^^^^^^^^^^^^^^ -.. versionadded:: 0.40.6 -``changeStatus`` -This action will assign a new status to the deal, with optional a ``Condition``. +Change Deal Status + .. versionadded:: 0.40.6 + This action will assign a new status to the deal, with optional a ``Condition``. -syntax - .. code-block:: python + syntax + .. code-block:: python - ["changeStatus",] - ["changeStatus",,] + ["changeStatus",] + ["changeStatusIf",,] Inspect Variables during waterfall