Parameters ---------- disk_cache : int whether to skip(0)/use(1)/replace(2) disk_cache This function will try to use cache method which has a keyword `disk_cache`, and will use provider method if a type error is raised because the DatasetD insta
(
self,
instruments,
fields,
start_time=None,
end_time=None,
freq="day",
disk_cache=None,
inst_processors=[],
)
| 1160 | return Inst.list_instruments(instruments, start_time, end_time, freq, as_list) |
| 1161 | |
| 1162 | def features( |
| 1163 | self, |
| 1164 | instruments, |
| 1165 | fields, |
| 1166 | start_time=None, |
| 1167 | end_time=None, |
| 1168 | freq="day", |
| 1169 | disk_cache=None, |
| 1170 | inst_processors=[], |
| 1171 | ): |
| 1172 | """ |
| 1173 | Parameters |
| 1174 | ---------- |
| 1175 | disk_cache : int |
| 1176 | whether to skip(0)/use(1)/replace(2) disk_cache |
| 1177 | |
| 1178 | |
| 1179 | This function will try to use cache method which has a keyword `disk_cache`, |
| 1180 | and will use provider method if a type error is raised because the DatasetD instance |
| 1181 | is a provider class. |
| 1182 | """ |
| 1183 | disk_cache = C.default_disk_cache if disk_cache is None else disk_cache |
| 1184 | fields = list(fields) # In case of tuple. |
| 1185 | try: |
| 1186 | return DatasetD.dataset( |
| 1187 | instruments, fields, start_time, end_time, freq, disk_cache, inst_processors=inst_processors |
| 1188 | ) |
| 1189 | except TypeError: |
| 1190 | return DatasetD.dataset(instruments, fields, start_time, end_time, freq, inst_processors=inst_processors) |
| 1191 | |
| 1192 | |
| 1193 | class LocalProvider(BaseProvider): |