mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-02 02:21:18 +08:00
black format
This commit is contained in:
@@ -1385,6 +1385,7 @@ class Cov(PairRolling):
|
||||
def __init__(self, feature_left, feature_right, N):
|
||||
super(Cov, self).__init__(feature_left, feature_right, N, "cov")
|
||||
|
||||
|
||||
Operators = OpsWrapper()
|
||||
|
||||
OpsList = [
|
||||
@@ -1435,4 +1436,4 @@ OpsList = [
|
||||
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])
|
||||
raise ValueError(f"unsupported file type `{extension}`")
|
||||
|
||||
|
||||
#################### Operator Wrapper #####################
|
||||
|
||||
|
||||
class OpsWrapper(object):
|
||||
"""Ops Wrapper"""
|
||||
|
||||
def __init__(self):
|
||||
self._ops = {}
|
||||
|
||||
def register(self, ops_list):
|
||||
|
||||
for operator in ops_list:
|
||||
@@ -744,4 +747,4 @@ class OpsWrapper(object):
|
||||
def __getattr__(self, key):
|
||||
if self._ops is {}:
|
||||
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