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

Function register_wrapper

qlib/utils/__init__.py:876–886  ·  view source on GitHub ↗

register_wrapper :param wrapper: A wrapper. :param cls_or_obj: A class or class name or object instance.

(wrapper, cls_or_obj, module_path=None)

Source from the content-addressed store, hash-verified

874
875
876def register_wrapper(wrapper, cls_or_obj, module_path=None):
877 """register_wrapper
878
879 :param wrapper: A wrapper.
880 :param cls_or_obj: A class or class name or object instance.
881 """
882 if isinstance(cls_or_obj, str):
883 module = get_module_by_module_path(module_path)
884 cls_or_obj = getattr(module, cls_or_obj)
885 obj = cls_or_obj() if isinstance(cls_or_obj, type) else cls_or_obj
886 wrapper.register(obj)
887
888
889def load_dataset(path_or_obj, index_col=[0, 1]):

Callers 1

register_all_wrappersFunction · 0.85

Calls 2

registerMethod · 0.45

Tested by

no test coverage detected