From 7a46f8edd5545a8f399e8e17263a9a5f9f170665 Mon Sep 17 00:00:00 2001 From: Xiaoyu Date: Sat, 23 Dec 2023 22:20:07 +0800 Subject: [PATCH] expose excess --- absbox/client.py | 7 ++----- absbox/local/component.py | 4 +++- absbox/tests/benchmark/us/float_bond.py | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/absbox/client.py b/absbox/client.py index c9a0186..978c48e 100644 --- a/absbox/client.py +++ b/absbox/client.py @@ -112,12 +112,9 @@ def run(self, deal, else: result = self._send_req(req, url, timeout=30) - if result is None: + if result is None or 'error' in result: console.print("❌[bold red]Failed to get response from run") - console.print_json(req) - return None - if 'error' in result: - rich.print_json(result) + #console.print_json(req) return None rawErrorMsg = [] diff --git a/absbox/local/component.py b/absbox/local/component.py index 79940f4..575f644 100644 --- a/absbox/local/component.py +++ b/absbox/local/component.py @@ -337,6 +337,8 @@ def mkDs(x): return mkTag(("FloorWith", [mkDs(ds1), mkDs(ds2)])) case ("floorWithZero", ds1): return mkTag(("FloorWithZero", mkDs(ds1))) + case ("excess", ds1, *dss) | ("超额", ds1, *dss): + return mkTag(("Excess", mkDs(ds1)+[mkDs(_) for _ in dss])) case ("capWith", ds1, ds2): return mkTag(("CapWith", [mkDs(ds1), mkDs(ds2)])) case ("/", ds1, ds2) | ("divide", ds1, ds2): @@ -366,7 +368,7 @@ def queryType(y): # return "IfBool" case _: return "If" - + match p: case ["状态", _st] | ["status", _st]: return mkTag(("IfDealStatus", mkStatus(_st))) diff --git a/absbox/tests/benchmark/us/float_bond.py b/absbox/tests/benchmark/us/float_bond.py index 0e4a920..26dc73f 100644 --- a/absbox/tests/benchmark/us/float_bond.py +++ b/absbox/tests/benchmark/us/float_bond.py @@ -1,4 +1,4 @@ -from absbox.local.generic import Generic +from absbox import Generic from absbox import API