Skip to content

Commit

Permalink
expose excess
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowbean committed Dec 23, 2023
1 parent 61423dc commit 7a46f8e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 2 additions & 5 deletions absbox/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
4 changes: 3 additions & 1 deletion absbox/local/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -366,7 +368,7 @@ def queryType(y):
# return "IfBool"
case _:
return "If"

match p:
case ["状态", _st] | ["status", _st]:
return mkTag(("IfDealStatus", mkStatus(_st)))
Expand Down
2 changes: 1 addition & 1 deletion absbox/tests/benchmark/us/float_bond.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from absbox.local.generic import Generic
from absbox import Generic
from absbox import API


Expand Down

0 comments on commit 7a46f8e

Please sign in to comment.