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

Method multi_cache_walker

qlib/data/data.py:930–948  ·  view source on GitHub ↗

This method is used to prepare the expression cache for the client. Then the client will load the data from expression cache by itself.

(instruments, fields, start_time=None, end_time=None, freq="day")

Source from the content-addressed store, hash-verified

928
929 @staticmethod
930 def multi_cache_walker(instruments, fields, start_time=None, end_time=None, freq="day"):
931 """
932 This method is used to prepare the expression cache for the client.
933 Then the client will load the data from expression cache by itself.
934
935 """
936 instruments_d = DatasetProvider.get_instruments_d(instruments, freq)
937 column_names = DatasetProvider.get_column_names(fields)
938 cal = Cal.calendar(start_time, end_time, freq)
939 if len(cal) == 0:
940 return
941 start_time = cal[0]
942 end_time = cal[-1]
943 workers = max(min(C.kernels, len(instruments_d)), 1)
944
945 ParallelExt(n_jobs=workers, backend=C.joblib_backend, maxtasksperchild=C.maxtasksperchild)(
946 delayed(LocalDatasetProvider.cache_walker)(inst, start_time, end_time, freq, column_names)
947 for inst in instruments_d
948 )
949
950 @staticmethod
951 def cache_walker(inst, start_time, end_time, freq, column_names):

Callers 1

_dataset_uriMethod · 0.80

Calls 4

ParallelExtClass · 0.85
get_instruments_dMethod · 0.80
get_column_namesMethod · 0.80
calendarMethod · 0.45

Tested by

no test coverage detected