-
Notifications
You must be signed in to change notification settings - Fork 678
Implement Google options functionality #183
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
Conversation
def _process_rows(self, l, rows_list, now, index, expiry, type, underlying_price): | ||
for row in l: | ||
dict = {} | ||
try: |
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 prefer loops over keys to avoid repeat.
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.
Moved inside _process_rows()
for key, type in [['calls', 'call'], ['puts', 'put']]: | ||
for row in jd[key]: | ||
d = {} | ||
try: |
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.
Use loop.
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.
Could you offer a snippet on how to change this?
Thanks for this. Maybe we should fix / refactor yahoo options at some point. |
return df.sort_index() | ||
|
||
def _process_rows(self, jd, rows_list, now, index, expiry): | ||
for key, type in [['calls', 'call'], ['puts', 'put']]: |
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.
typ
not type
because of shadowing
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.
Done.
@sinhrks Would an issue be the best forum to discuss refactoring? |
|
||
The class has the following methods: | ||
get_options_data(month, year, expiry) | ||
get_call_data(month, year, expiry) |
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.
Following methods are not supported, correct? Pls update docstring and example to meet the current spec (or raise NotImplementedError
).
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.
For now I'm raising NotImplementedError.
Thanks for the update. Can you also update docs ( |
Done. |
The failed tests are unrelated
|
I've retriggered tests. |
Would you like to see some other updates for this? Thanks |
Thanks, looks good to me. Could you squash to single commit? |
Squashed. |
It sounds good to me also. @sinhrks you can merge. |
Implement Google options functionality
@gliptak Thanks! |
Please review. Thanks