Files
NexQuant/rdagent/components/coder/model_coder/CoSTEER/evolvable_subjects.py
T

30 lines
978 B
Python
Raw Normal View History

from rdagent.components.coder.model_coder.model import (
ModelExperiment,
2024-07-17 15:00:13 +08:00
ModelFBWorkspace,
ModelTask,
)
from rdagent.core.evolving_framework import EvolvableSubjects
2024-07-16 20:35:42 +08:00
from rdagent.log import rdagent_logger as logger
class ModelEvolvingItem(ModelExperiment, EvolvableSubjects):
"""
Intermediate item of model implementation.
"""
def __init__(
self,
sub_tasks: list[ModelTask],
2024-07-17 15:00:13 +08:00
sub_gt_implementations: list[ModelFBWorkspace] = None,
):
ModelExperiment.__init__(self, sub_tasks=sub_tasks)
if sub_gt_implementations is not None and len(
sub_gt_implementations,
) != len(self.sub_tasks):
self.sub_gt_implementations = None
2024-07-16 20:35:42 +08:00
logger.warning(
"The length of sub_gt_implementations is not equal to the length of sub_tasks, set sub_gt_implementations to None",
)
else:
self.sub_gt_implementations = sub_gt_implementations