mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-27 23:47:46 +00:00
fix: Add framework handling for task coding failure. (#176)
* Add framework handling for task coding failure. * fix a ci bug
This commit is contained in:
@@ -671,6 +671,10 @@ class FactorMultiEvaluator(Evaluator):
|
||||
]
|
||||
logger.info(f"Final decisions: {final_decision} True count: {final_decision.count(True)}")
|
||||
|
||||
for index in range(len(evo.sub_tasks)):
|
||||
if final_decision[index]:
|
||||
evo.sub_tasks[index].factor_implementation = True
|
||||
|
||||
return multi_implementation_feedback
|
||||
|
||||
|
||||
|
||||
@@ -26,12 +26,14 @@ class FactorTask(Task):
|
||||
factor_formulation,
|
||||
variables: dict = {},
|
||||
resource: str = None,
|
||||
factor_implementation: bool = False,
|
||||
) -> None:
|
||||
self.factor_name = factor_name
|
||||
self.factor_description = factor_description
|
||||
self.factor_formulation = factor_formulation
|
||||
self.variables = variables
|
||||
self.factor_resources = resource
|
||||
self.factor_implementation = factor_implementation
|
||||
|
||||
def get_task_information(self):
|
||||
return f"""factor_name: {self.factor_name}
|
||||
@@ -39,6 +41,15 @@ factor_description: {self.factor_description}
|
||||
factor_formulation: {self.factor_formulation}
|
||||
variables: {str(self.variables)}"""
|
||||
|
||||
def get_task_information_and_implementation_result(self):
|
||||
return {
|
||||
"factor_name": self.factor_name,
|
||||
"factor_description": self.factor_description,
|
||||
"factor_formulation": self.factor_formulation,
|
||||
"variables": str(self.variables),
|
||||
"factor_implementation": str(self.factor_implementation),
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
def from_dict(dict):
|
||||
return FactorTask(**dict)
|
||||
|
||||
Reference in New Issue
Block a user