Skip to content
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

Merged
merged 6 commits into from Feb 5, 2021

Conversation

bxdd
Copy link
Collaborator

@bxdd bxdd commented Feb 2, 2021

Description

Update Highfreq Handler & Ops / Fix a Highfreq Bug

Motivation and Context

How Has This Been Tested?

  • Pass the test by running: pytest qlib/tests/test_all_pipeline.py under upper directory of qlib.
  • If you are adding a new feature, test on your own test scripts.

Screenshots of Test Results (if appropriate):

  1. Pipeline test:
  2. Your own tests:

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

@Derek-Wds Derek-Wds added the bug Something isn't working label Feb 3, 2021
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):
Copy link
Collaborator

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


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)
Copy link
Collaborator

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 ?

Copy link
Collaborator Author

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 Show resolved Hide resolved
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):
Copy link
Collaborator

@you-n-g you-n-g Feb 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@you-n-g you-n-g merged commit 07b905c into microsoft:main Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants