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

Method __init__

qlib/data/dataset/handler.py:106–152  ·  view source on GitHub ↗

Parameters ---------- instruments : The stock list to retrieve. start_time : start_time of the original data. end_time : end_time of the original data. data_loader : Union[dict, str, DataLoader] data loa

(
        self,
        instruments=None,
        start_time=None,
        end_time=None,
        data_loader: Union[dict, str, DataLoader] = None,
        init_data=True,
        fetch_orig=True,
    )

Source from the content-addressed store, hash-verified

104 _data: pd.DataFrame # underlying data.
105
106 def __init__(
107 self,
108 instruments=None,
109 start_time=None,
110 end_time=None,
111 data_loader: Union[dict, str, DataLoader] = None,
112 init_data=True,
113 fetch_orig=True,
114 ):
115 """
116 Parameters
117 ----------
118 instruments :
119 The stock list to retrieve.
120 start_time :
121 start_time of the original data.
122 end_time :
123 end_time of the original data.
124 data_loader : Union[dict, str, DataLoader]
125 data loader to load the data.
126 init_data :
127 initialize the original data in the constructor.
128 fetch_orig : bool
129 Return the original data instead of copy if possible.
130 """
131
132 # Setup data loader
133 assert data_loader is not None # to make start_time end_time could have None default value
134
135 # what data source to load data
136 self.data_loader = init_instance_by_config(
137 data_loader,
138 None if (isinstance(data_loader, dict) and "module_path" in data_loader) else data_loader_module,
139 accept_types=DataLoader,
140 )
141
142 # what data to be loaded from data source
143 # For IDE auto-completion.
144 self.instruments = instruments
145 self.start_time = start_time
146 self.end_time = end_time
147
148 self.fetch_orig = fetch_orig
149 if init_data:
150 with TimeInspector.logt("Init data"):
151 self.setup_data()
152 super().__init__()
153
154 def config(self, **kwargs):
155 """

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls 3

setup_dataMethod · 0.95
init_instance_by_configFunction · 0.85
logtMethod · 0.80

Tested by

no test coverage detected