New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Highfreq Handler & Ops / Fix a Highfreq Bug #254
Conversation
examples/highfreq/highfreq_ops.py
Outdated
def __init__(self, feature, l=None, r=None): | ||
self.l = l | ||
self.r = r | ||
if (self.l != None and self.l <= 0) or (self.r != None and self.r >= 0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is None
is better than != None
examples/highfreq/highfreq_ops.py
Outdated
|
||
def get_extended_window_size(self): | ||
ll = 0 if self.l == None else self.l | ||
rr = 0 if self.r == None else abs(self.r) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why abs is only used for self.r
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope that self.l > 0 and self.r < 0. It mean cut slice [self.l, self.len + r)
of raw data.
examples/highfreq/highfreq_ops.py
Outdated
def __init__(self, feature, l=None, r=None): | ||
self.l = l | ||
self.r = r | ||
if (self.l != None and self.l <= 0) or (self.r != None and self.r >= 0): | ||
if (not self.l is None and self.l <= 0) or (not self.r is None and self.r >= 0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is right, but it looks weird.
XXX is not YYYY
is preferred than not XXX is YYYY
Description
Update Highfreq Handler & Ops / Fix a Highfreq Bug
Motivation and Context
How Has This Been Tested?
pytest qlib/tests/test_all_pipeline.py
under upper directory ofqlib
.Screenshots of Test Results (if appropriate):
Types of changes