mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-14 08:16:54 +08:00
fix cant find ops error on Windows
This commit is contained in:
@@ -60,11 +60,11 @@ class Distance(PairOperator):
|
|||||||
series_right = self.feature_right.load(instrument, start_index, end_index, freq)
|
series_right = self.feature_right.load(instrument, start_index, end_index, freq)
|
||||||
return np.abs(series_left - series_right)
|
return np.abs(series_left - series_right)
|
||||||
|
|
||||||
|
OpsList = [Diff, Distance]
|
||||||
|
Operators.register(OpsList)
|
||||||
|
|
||||||
class TestRegiterCustomOps(TestAutoData):
|
class TestRegiterCustomOps(TestAutoData):
|
||||||
def test_regiter_custom_ops(self):
|
def test_regiter_custom_ops(self):
|
||||||
OpsList = [Diff, Distance]
|
|
||||||
Operators.register(OpsList)
|
|
||||||
instruments = ["SH600000"]
|
instruments = ["SH600000"]
|
||||||
fields = ["Diff($close)", "Distance($close, Ref($close, 1))"]
|
fields = ["Diff($close)", "Distance($close, Ref($close, 1))"]
|
||||||
print(D.features(instruments, fields, start_time="2010-01-01", end_time="2017-12-31", freq="day"))
|
print(D.features(instruments, fields, start_time="2010-01-01", end_time="2017-12-31", freq="day"))
|
||||||
|
|||||||
Reference in New Issue
Block a user