mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-12 15:26:54 +08:00
black format
This commit is contained in:
@@ -1385,6 +1385,7 @@ class Cov(PairRolling):
|
|||||||
def __init__(self, feature_left, feature_right, N):
|
def __init__(self, feature_left, feature_right, N):
|
||||||
super(Cov, self).__init__(feature_left, feature_right, N, "cov")
|
super(Cov, self).__init__(feature_left, feature_right, N, "cov")
|
||||||
|
|
||||||
|
|
||||||
Operators = OpsWrapper()
|
Operators = OpsWrapper()
|
||||||
|
|
||||||
OpsList = [
|
OpsList = [
|
||||||
@@ -1435,4 +1436,4 @@ OpsList = [
|
|||||||
If,
|
If,
|
||||||
]
|
]
|
||||||
|
|
||||||
Operators.register(OpsList)
|
Operators.register(OpsList)
|
||||||
|
|||||||
@@ -729,13 +729,16 @@ def load_dataset(path_or_obj):
|
|||||||
return pd.read_csv(path_or_obj, parse_dates=True, index_col=[0, 1])
|
return pd.read_csv(path_or_obj, parse_dates=True, index_col=[0, 1])
|
||||||
raise ValueError(f"unsupported file type `{extension}`")
|
raise ValueError(f"unsupported file type `{extension}`")
|
||||||
|
|
||||||
|
|
||||||
#################### Operator Wrapper #####################
|
#################### Operator Wrapper #####################
|
||||||
|
|
||||||
|
|
||||||
class OpsWrapper(object):
|
class OpsWrapper(object):
|
||||||
"""Ops Wrapper"""
|
"""Ops Wrapper"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._ops = {}
|
self._ops = {}
|
||||||
|
|
||||||
def register(self, ops_list):
|
def register(self, ops_list):
|
||||||
|
|
||||||
for operator in ops_list:
|
for operator in ops_list:
|
||||||
@@ -744,4 +747,4 @@ class OpsWrapper(object):
|
|||||||
def __getattr__(self, key):
|
def __getattr__(self, key):
|
||||||
if self._ops is {}:
|
if self._ops is {}:
|
||||||
raise AttributeError("Please run qlib.init() first using qlib to register ops")
|
raise AttributeError("Please run qlib.init() first using qlib to register ops")
|
||||||
return self._ops[key]
|
return self._ops[key]
|
||||||
|
|||||||
Reference in New Issue
Block a user