| 10 | |
| 11 | |
| 12 | def 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 = [ |