From 698f89e07c7317a60124888ac61a6bf5501c10ed Mon Sep 17 00:00:00 2001 From: Xu Yang Date: Thu, 12 Jun 2025 17:34:51 +0800 Subject: [PATCH] print out the qlib data generation error message to help user find the problem (#954) Co-authored-by: Xu Yang --- rdagent/scenarios/qlib/experiment/utils.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/rdagent/scenarios/qlib/experiment/utils.py b/rdagent/scenarios/qlib/experiment/utils.py index 0edde395..a1a1fa44 100644 --- a/rdagent/scenarios/qlib/experiment/utils.py +++ b/rdagent/scenarios/qlib/experiment/utils.py @@ -21,12 +21,14 @@ def generate_data_folder_from_qlib(): entry=f"python generate.py", ) - assert ( - Path(__file__).parent / "factor_data_template" / "daily_pv_all.h5" - ).exists(), "daily_pv_all.h5 is not generated." - assert ( - Path(__file__).parent / "factor_data_template" / "daily_pv_debug.h5" - ).exists(), "daily_pv_debug.h5 is not generated." + assert (Path(__file__).parent / "factor_data_template" / "daily_pv_all.h5").exists(), ( + "daily_pv_all.h5 is not generated. It means rdagent/scenarios/qlib/experiment/factor_data_template/generate.py is not executed correctly. Please check the log: \n" + + execute_log + ) + assert (Path(__file__).parent / "factor_data_template" / "daily_pv_debug.h5").exists(), ( + "daily_pv_debug.h5 is not generated. It means rdagent/scenarios/qlib/experiment/factor_data_template/generate.py is not executed correctly. Please check the log: \n" + + execute_log + ) Path(FACTOR_COSTEER_SETTINGS.data_folder).mkdir(parents=True, exist_ok=True) shutil.copy(