mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-01 17:37:43 +00:00
fix: eval_method cannot catch run factor error (#260)
* Update eval_method.py abort subsequent evaluators for invalid gen_df * add AttributeError * add raise_exception for eval_method * remove custom exception catch
This commit is contained in:
@@ -104,7 +104,7 @@ class BaseEval:
|
||||
try:
|
||||
eval_res.append((ev, ev.evaluate(implementation=case_gen, gt_implementation=case_gt)))
|
||||
# if the corr ev is successfully evaluated and achieve the best performance, then break
|
||||
except CoderError as e:
|
||||
except (CoderError, AttributeError) as e:
|
||||
return e
|
||||
except Exception as e:
|
||||
# exception when evaluation
|
||||
|
||||
@@ -55,10 +55,9 @@ class FactorTestCaseLoaderFromJsonFile:
|
||||
factor_formulation=factor_data["formulation"],
|
||||
variables=factor_data["variables"],
|
||||
)
|
||||
gt = FactorFBWorkspace(task)
|
||||
gt = FactorFBWorkspace(task, raise_exception=True)
|
||||
code = {"factor.py": factor_data["gt_code"]}
|
||||
gt.inject_code(**code)
|
||||
gt.execute()
|
||||
TestData.target_task.sub_tasks.append(task)
|
||||
TestData.ground_truth.append(gt)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user