From 06a5d5d92d90fc50b574ad2d3be44006219e300e Mon Sep 17 00:00:00 2001 From: TPTBusiness Date: Sun, 3 May 2026 21:38:09 +0200 Subject: [PATCH] refactor: move strategy_orchestrator and optuna_optimizer to closed-source (local/) --- .gitignore | 2 +- rdagent/app/cli.py | 2 +- rdagent/app/qlib_rd_loop/quant.py | 2 +- rdagent/components/backtesting/vbt_backtest.py | 4 ++-- test/local/test_bug_fixes.py | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 3fde52fa..74f71f72 100644 --- a/.gitignore +++ b/.gitignore @@ -140,4 +140,4 @@ pickle_cache/ RD-Agent_workspace_run*/ AGENTS.md CLAUDE.md -.claude/ \ No newline at end of file +.claude/rdagent/components/coder/strategy_orchestrator.py diff --git a/rdagent/app/cli.py b/rdagent/app/cli.py index 9241a998..d420f38f 100644 --- a/rdagent/app/cli.py +++ b/rdagent/app/cli.py @@ -681,7 +681,7 @@ def generate_strategies_cli( try: import pandas as pd - from rdagent.components.coder.strategy_orchestrator import StrategyOrchestrator + from rdagent.scenarios.qlib.local.strategy_orchestrator import StrategyOrchestrator all_results = [] best_strategy = None diff --git a/rdagent/app/qlib_rd_loop/quant.py b/rdagent/app/qlib_rd_loop/quant.py index c6f6c3eb..1c932c42 100644 --- a/rdagent/app/qlib_rd_loop/quant.py +++ b/rdagent/app/qlib_rd_loop/quant.py @@ -293,7 +293,7 @@ class QuantRDLoop(RDLoop): from pathlib import Path import yaml - from rdagent.components.coder.strategy_orchestrator import StrategyOrchestrator + from rdagent.scenarios.qlib.local.strategy_orchestrator import StrategyOrchestrator # Load improved prompt project_root = Path(__file__).parent.parent.parent.parent diff --git a/rdagent/components/backtesting/vbt_backtest.py b/rdagent/components/backtesting/vbt_backtest.py index 8830fcd7..4c64e0cf 100644 --- a/rdagent/components/backtesting/vbt_backtest.py +++ b/rdagent/components/backtesting/vbt_backtest.py @@ -3,8 +3,8 @@ Unified, verifiable backtesting engine. Single entry point (`backtest_signal`) used by: - scripts/predix_gen_strategies_real_bt.py - - rdagent/components/coder/strategy_orchestrator.py - - rdagent/components/coder/optuna_optimizer.py + - rdagent/scenarios/qlib/local/strategy_orchestrator.py + - rdagent/scenarios/qlib/local/optuna_optimizer.py - rdagent/components/backtesting/backtest_engine.py Design goals diff --git a/test/local/test_bug_fixes.py b/test/local/test_bug_fixes.py index 732f550e..7993a85c 100644 --- a/test/local/test_bug_fixes.py +++ b/test/local/test_bug_fixes.py @@ -45,7 +45,7 @@ class TestStrategyOrchestratorSyntax: def test_module_imports(self): """Verify StrategyOrchestrator can be imported after syntax fix.""" - from rdagent.components.coder.strategy_orchestrator import StrategyOrchestrator + from rdagent.scenarios.qlib.local.strategy_orchestrator import StrategyOrchestrator assert StrategyOrchestrator is not None @@ -263,7 +263,7 @@ class TestRebacktestBareExcept: class TestAllImportsDontCrash: def test_strategy_orchestrator_imports(self): """Verify all fixed modules import without errors.""" - import rdagent.components.coder.strategy_orchestrator # noqa: F401 + # moved to local/ # noqa: F401 def test_factor_runner_imports(self): import rdagent.scenarios.qlib.developer.factor_runner # noqa: F401 @@ -278,4 +278,4 @@ class TestAllImportsDontCrash: import rdagent.scenarios.qlib.developer.model_runner # noqa: F401 def test_optuna_optimizer_imports(self): - import rdagent.components.coder.optuna_optimizer # noqa: F401 + # moved to local/ # noqa: F401