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")
| 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): |
no test coverage detected