MCPcopy
hub / github.com/microsoft/qlib / setUpClass

Method setUpClass

tests/test_pit.py:39–64  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

37
38 @classmethod
39 def setUpClass(cls) -> None:
40 cn_data_dir = str(QLIB_DIR.joinpath("cn_data").resolve())
41 pit_dir = str(SOURCE_DIR.joinpath("pit").resolve())
42 pit_normalized_dir = str(SOURCE_DIR.joinpath("pit_normalized").resolve())
43 GetData().qlib_data(
44 name="qlib_data_simple", target_dir=cn_data_dir, region="cn", delete_old=False, exists_skip=True
45 )
46 GetData().qlib_data(name="qlib_data", target_dir=pit_dir, region="pit", delete_old=False, exists_skip=True)
47
48 # 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.
49 # bs.login()
50 # Run(
51 # source_dir=pit_dir,
52 # interval="quarterly",
53 # ).download_data(start="2000-01-01", end="2020-01-01", symbol_regex="^(600519|000725).*")
54 # bs.logout()
55
56 Run(
57 source_dir=pit_dir,
58 normalize_dir=pit_normalized_dir,
59 interval="quarterly",
60 ).normalize_data()
61 DumpPitData(
62 csv_path=pit_normalized_dir,
63 qlib_dir=cn_data_dir,
64 ).dump(interval="quarterly")
65
66 def setUp(self):
67 # qlib.init(kernels=1) # NOTE: set kernel to 1 to make it debug easier

Callers

nothing calls this directly

Calls 6

GetDataClass · 0.90
RunClass · 0.90
DumpPitDataClass · 0.90
qlib_dataMethod · 0.80
normalize_dataMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected