From 226857886ba844bd339a2cb6d0d53accd659a207 Mon Sep 17 00:00:00 2001 From: genisis0x Date: Thu, 14 May 2026 13:21:34 +0530 Subject: [PATCH] chore: fix comment typos in core and utils Sweep of inline-comment / docstring typos surfaced by codespell. - rdagent/core/evolving_agent.py: 'compelete' -> 'complete' (and tidy 'be break down' -> 'be broken down' in the same line). - rdagent/core/proposal.py: 'Runable reuslts' -> 'Runnable results'; 'unifiy the loop_id' -> 'unify the loop_id'. - rdagent/utils/agent/tpl.py: 'Content loading prioirties' -> 'Content loading priorities'. - rdagent/utils/workflow/loop.py: two 'incase user override' notes -> 'in case user overrides'; one 'comparision target in feedbck' -> 'comparison target in feedback'. Comment/docstring-only; no behavior change. --- rdagent/core/evolving_agent.py | 2 +- rdagent/core/proposal.py | 4 ++-- rdagent/utils/agent/tpl.py | 2 +- rdagent/utils/workflow/loop.py | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rdagent/core/evolving_agent.py b/rdagent/core/evolving_agent.py index 24e5afdb5..d69bc5b61 100644 --- a/rdagent/core/evolving_agent.py +++ b/rdagent/core/evolving_agent.py @@ -151,7 +151,7 @@ def multistep_evolve( queried_knowledge = self.rag.query(evo, self.evolving_trace) # 2. evolve: - # A compelete solution of an evo can be break down into multiple evolving steps. + # A complete solution of an evo can be broken down into multiple evolving steps. # Each evolving step can be evaluated separately. # Assumptions: # - if we want to stop on some point of the implementation, we must have a according evaluator (Otherwise, It is meaningless to stop) diff --git a/rdagent/core/proposal.py b/rdagent/core/proposal.py index 39cd0523c..37322594a 100644 --- a/rdagent/core/proposal.py +++ b/rdagent/core/proposal.py @@ -69,7 +69,7 @@ def __init__( self.eda_improvement = eda_improvement self.reason = reason # Exception is not None means failing to generate runnable experiments due to exception. - # Runable reuslts are not always good. + # Runnable results are not always good. self.exception: Exception | None = ( exception # if the experiment raises exception, it will be integrated into part of the feedback. ) @@ -165,7 +165,7 @@ def __init__(self, scen: ASpecificScen, knowledge_base: ASpecificKB | None = Non self.idx2loop_id: dict[int, int] = {} # Design discussion: - # - If we unifiy the loop_id and the enqueue id, we will have less recognition burden. + # - If we unify the loop_id and the enqueue id, we will have less recognition burden. # - If we use different id for loop and enqueue, we don't have to handle the placeholder logic. # END: graph structure ------------------------- diff --git a/rdagent/utils/agent/tpl.py b/rdagent/utils/agent/tpl.py index 9dc1c3da7..a620af7ef 100644 --- a/rdagent/utils/agent/tpl.py +++ b/rdagent/utils/agent/tpl.py @@ -104,7 +104,7 @@ def __init__(self, uri: str, ftype: str = "yaml"): the loaded content will be saved in `self.template` - Content loading prioirties: + Content loading priorities: -.a.b.c has the highest priority - /a/b/c.yaml via a.b.c (So you can make customization under current directory) - /a/b/c.yaml via a.b.c (RD-Agent provides the default template) diff --git a/rdagent/utils/workflow/loop.py b/rdagent/utils/workflow/loop.py index fe54d986b..aa3b3be10 100644 --- a/rdagent/utils/workflow/loop.py +++ b/rdagent/utils/workflow/loop.py @@ -46,7 +46,7 @@ def _get_steps(bases: tuple[type, ...]) -> list[str]: steps = [] for base in bases: for step in LoopMeta._get_steps(base.__bases__) + getattr(base, "steps", []): - if step not in steps and step not in ["load", "dump"]: # incase user override the load/dump method + if step not in steps and step not in ["load", "dump"]: # in case user overrides the load/dump method steps.append(step) return steps @@ -66,7 +66,7 @@ def __new__(mcs, clsname: str, bases: tuple[type, ...], attrs: dict[str, Any]) - for name, attr in attrs.items(): if not name.startswith("_") and callable(attr) and not isinstance(attr, type): # NOTE: `not isinstance(attr, type)` is trying to exclude class type attribute - if name not in steps and name not in ["load", "dump"]: # incase user override the load/dump method + if name not in steps and name not in ["load", "dump"]: # in case user overrides the load/dump method # NOTE: if we override the step in the subclass # Then it is not the new step. So we skip it. steps.append(name) @@ -148,7 +148,7 @@ def get_semaphore(self, step_name: str) -> asyncio.Semaphore: # NOTE: # (1) we assume the record step is always the last step to modify the global environment, # so we set the limit to 1 to avoid race condition - # (2) Because we support (-1,) as local selection; So it is hard to align a) the comparision target in `feedbck` + # (2) Because we support (-1,) as local selection; So it is hard to align a) the comparison target in `feedback` # and b) parent node in `record`; So we prevent parallelism in `feedback` and `record` to avoid inconsistency if step_name in ("record", "feedback"): limit = 1