mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-27 23:47:46 +00:00
refactor: add string validation for feedback attrs and remove unused var (#1035)
This commit is contained in:
@@ -70,6 +70,10 @@ class CoSTEERSingleFeedback(Feedback):
|
||||
|
||||
if not isinstance(data["final_decision"], bool):
|
||||
raise ValueError(f"'final_decision' must be a boolean, not {type(data['final_decision'])}")
|
||||
|
||||
for attr in "execution", "return_checking", "code":
|
||||
if data[attr] is not None and not isinstance(data[attr], str):
|
||||
raise ValueError(f"'{attr}' must be a string, not {type(data[attr])}")
|
||||
return data
|
||||
|
||||
def __str__(self) -> str:
|
||||
|
||||
@@ -62,7 +62,6 @@ class PipelineCoSTEEREvaluator(CoSTEEREvaluator):
|
||||
result = implementation.run(env=env, entry=f"python -m coverage run main.py --debug")
|
||||
else:
|
||||
result = implementation.run(env=env, entry=f"python -m coverage run main.py")
|
||||
execute_ret_code = result.exit_code
|
||||
result.stdout = remove_eda_part(result.stdout)
|
||||
if result.exit_code != 0:
|
||||
stdout += f"Code failed to run. Please check the stdout:\n Following the stdout of the debug mode run:\n{result.stdout.strip()}\n"
|
||||
|
||||
Reference in New Issue
Block a user