From 2ca0d88d2dead471c516460906fc67725d83bc6e Mon Sep 17 00:00:00 2001 From: Linlang <30293408+SunsetWolf@users.noreply.github.com> Date: Tue, 28 Jun 2022 16:29:59 +0800 Subject: [PATCH] change_pitdata_source (#1171) * change_pitdata_source * retain_normalize * add_comment --- tests/test_pit.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/test_pit.py b/tests/test_pit.py index b524e6b57..1b1eaec89 100644 --- a/tests/test_pit.py +++ b/tests/test_pit.py @@ -40,17 +40,21 @@ class TestPIT(unittest.TestCase): pit_dir = str(SOURCE_DIR.joinpath("pit").resolve()) pit_normalized_dir = str(SOURCE_DIR.joinpath("pit_normalized").resolve()) GetData().qlib_data(name="qlib_data_simple", target_dir=cn_data_dir, region="cn") - bs.login() - Run( - source_dir=pit_dir, - interval="quarterly", - ).download_data(start="2000-01-01", end="2020-01-01", symbol_regex="^(600519|000725).*") + GetData().qlib_data(name="qlib_data", target_dir=pit_dir, region="pit") + + # NOTE: This code does the same thing as line 43, but since baostock is not stable in downloading data, we have chosen to download offline data. + # bs.login() + # Run( + # source_dir=pit_dir, + # interval="quarterly", + # ).download_data(start="2000-01-01", end="2020-01-01", symbol_regex="^(600519|000725).*") + # bs.logout() + Run( source_dir=pit_dir, normalize_dir=pit_normalized_dir, interval="quarterly", ).normalize_data() - bs.logout() DumpPitData( csv_path=pit_normalized_dir, qlib_dir=cn_data_dir,