Skip to content

Commit

Permalink
fixed getrgf testing to handle timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
YukiYang31 committed Mar 24, 2024
1 parent bd08145 commit 027cf9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Testing.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
python3 /app/code/experiments/function_calls/summer2023_tests/test_getrgf.py
# #must run this in order for mergeTestResult to work

python /app/code/experiments/function_calls/summer2023_tests/test_fcapc.py
# python /app/code/experiments/function_calls/summer2023_tests/test_fcapc.py

# python /app/code/experiments/function_calls/summer2023_tests/test_rapc.py

python /app/code/experiments/function_calls/summer2023_tests/mergeData.py
# python /app/code/experiments/function_calls/summer2023_tests/mergeData.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def collect(self) -> None:
for graph_name, graph in graphs.items():
print('Graph Name: ', graph_name)

getrgfapc: Union[str, PathComplexityRes] = {'rfcapc': 'na', "getrgfTime": 'na', "firstHalfTime": 'na'}
getrgfapc: Union[str, PathComplexityRes] = {'rfcapc': 'error, might be timeout', "getrgfTime": 'na', "firstHalfTime": 'na', "case": 'na', "gamma":'na'}
exception_type = "na"
getrgfruntime = 0.0

Expand All @@ -86,7 +86,7 @@ def collect(self) -> None:
print(exc)
exception_type = "Timeout" if isinstance(exc, TimeoutError) else "Other"


print(getrgfapc)
new_row = {"file_name": file, "graph_name": graph.name, "getrgfapc": getrgfapc["rfcapc"],
"getrgfapc_time": getrgfruntime, "longest for getrgf": get_max_time(getrgfapc)[0], "longest time":get_max_time(getrgfapc)[1],
"getrgfTime":getrgfapc["getrgfTime"], "firstHalfTime": getrgfapc['firstHalfTime'],
Expand Down Expand Up @@ -115,7 +115,7 @@ def round_expr(expr, num_digits):
return expr.xreplace({n : round(n, num_digits) for n in expr.atoms(Number)})

def get_max_time(apc):
if apc == {'rfcapc':"na"}:
if apc['rfcapc'] == 'error, might be timeout':
return ("na",0)
l = ["graphProcessTime","graphSystemsTime", "gammaTime", "discrimTime",
"realnrootsTime", "genFuncTime", "rootsDictTime","getrgfTime","apcTime2","cleanTime"]
Expand Down

0 comments on commit 027cf9e

Please sign in to comment.