mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-12 23:36:54 +08:00
Fix handler bug
This commit is contained in:
@@ -3,9 +3,10 @@
|
|||||||
|
|
||||||
from ...data.dataset.handler import DataHandlerLP
|
from ...data.dataset.handler import DataHandlerLP
|
||||||
from ...data.dataset.processor import Processor, MinMaxNorm, ZscoreNorm
|
from ...data.dataset.processor import Processor, MinMaxNorm, ZscoreNorm
|
||||||
from ...utils import get_cls_kwargs
|
from ...utils import get_cls_kwargs, get_module_by_module_path
|
||||||
from ...data.dataset import processor as processor_module
|
from ...data.dataset import processor as processor_module
|
||||||
from ...log import TimeInspector
|
from ...log import TimeInspector
|
||||||
|
from inspect import isclass
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
|
|
||||||
@@ -99,9 +100,11 @@ class Alpha158(DataHandlerLP):
|
|||||||
for p in proc_l:
|
for p in proc_l:
|
||||||
if not isinstance(p, Processor):
|
if not isinstance(p, Processor):
|
||||||
klass, pkwargs = get_cls_kwargs(p, processor_module)
|
klass, pkwargs = get_cls_kwargs(p, processor_module)
|
||||||
# FIXME: It's hard code here!!!!!
|
processors = get_module_by_module_path(processor_module.__name__)
|
||||||
if isinstance(klass, (MinMaxNorm, ZscoreNorm)):
|
if klass.__name__ in [c for c in dir(processor_module) if isclass(getattr(processor_module, c))]:
|
||||||
assert fit_start_time is not None and fit_end_time is not None
|
assert (
|
||||||
|
fit_start_time is not None and fit_end_time is not None
|
||||||
|
), "Make sure fit_start_time and fit_end_time are not None."
|
||||||
pkwargs.update(
|
pkwargs.update(
|
||||||
{
|
{
|
||||||
"fit_start_time": fit_start_time,
|
"fit_start_time": fit_start_time,
|
||||||
|
|||||||
Reference in New Issue
Block a user