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

Function check_transform_proc

qlib/contrib/data/handler.py:12–34  ·  view source on GitHub ↗
(proc_l, fit_start_time, fit_end_time)

Source from the content-addressed store, hash-verified

10
11
12def check_transform_proc(proc_l, fit_start_time, fit_end_time):
13 new_l = []
14 for p in proc_l:
15 if not isinstance(p, Processor):
16 klass, pkwargs = get_callable_kwargs(p, processor_module)
17 args = getfullargspec(klass).args
18 if "fit_start_time" in args and "fit_end_time" in args:
19 assert (
20 fit_start_time is not None and fit_end_time is not None
21 ), "Make sure `fit_start_time` and `fit_end_time` are not None."
22 pkwargs.update(
23 {
24 "fit_start_time": fit_start_time,
25 "fit_end_time": fit_end_time,
26 }
27 )
28 proc_config = {"class": klass.__name__, "kwargs": pkwargs}
29 if isinstance(p, dict) and "module_path" in p:
30 proc_config["module_path"] = p["module_path"]
31 new_l.append(proc_config)
32 else:
33 new_l.append(p)
34 return new_l
35
36
37_DEFAULT_LEARN_PROCESSORS = [

Callers 9

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls 2

get_callable_kwargsFunction · 0.85
updateMethod · 0.45

Tested by 1

__init__Method · 0.72