1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-06 04:20:57 +08:00

Update CI & add black formatter

This commit is contained in:
Jactus
2020-10-09 14:33:29 +08:00
committed by you-n-g
parent 143f3f985b
commit 7c6e5e822c
26 changed files with 194 additions and 255 deletions

View File

@@ -142,7 +142,7 @@ class SeriesDFilter(BaseDFilter):
the series of bool value indicating whether the date satisfies the filter condition and exists in target timestamp
"""
fstart, fend = list(filter_series.keys())[0], list(filter_series.keys())[-1]
filter_series = filter_series.astype('bool') # Make sure the filter_series is boolean
filter_series = filter_series.astype("bool") # Make sure the filter_series is boolean
timestamp_series[fstart:fend] = timestamp_series[fstart:fend] & filter_series
return timestamp_series

View File

@@ -16,7 +16,7 @@ try:
from ._libs.expanding import expanding_slope, expanding_rsquare, expanding_resi
except ImportError as err:
print(err)
print('Do not import qlib package in the repository directory')
print("Do not import qlib package in the repository directory")
exit(-1)
__all__ = (
@@ -1342,7 +1342,9 @@ class PairRolling(ExpressionOps):
if self.N == 0:
return np.inf
return (
max(self.feature_left.get_longest_back_rolling(), self.feature_right.get_longest_back_rolling()) + self.N - 1
max(self.feature_left.get_longest_back_rolling(), self.feature_right.get_longest_back_rolling())
+ self.N
- 1
)
def get_extended_window_size(self):
@@ -1411,4 +1413,3 @@ class Cov(PairRolling):
def __init__(self, feature_left, feature_right, N):
super(Cov, self).__init__(feature_left, feature_right, N, "cov")