-
Notifications
You must be signed in to change notification settings - Fork 142
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
Fix Ticker.history
bugs
#129
Conversation
Fixes: - dpguthrie#127 BUG: inaccurate evaluation of 'day' corresponding with close price. - dpguthrie#128 BUG: inaccurate intraday price indexing when exchanges observe DST. Also, improves performance by reducing DataFrame manipulations.
Codecov ReportBase: 94.60% // Head: 91.95% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #129 +/- ##
==========================================
- Coverage 94.60% 91.95% -2.65%
==========================================
Files 10 10
Lines 853 883 +30
==========================================
+ Hits 807 812 +5
- Misses 46 71 +25
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
WRT the timezone of the returned index, at the moment this PR maintains the existing behavior, which is to say that the index of intraday data and the 'live indice' of daily data are returned with no timezone information. The actual timezone that the values reflect will be utc or local as determined by the |
Adds timezone info to: - index of intraday data. - any live indice of daily data. Also, sets column order of return as ohlcv then any 'adjclose', 'dividends', 'splits'.
231190f
to
b392d67
Compare
Added tests. I've also set the order of the columns of the returned dataframe to ohlcv followed by any 'adjclose', 'dividends', 'splits' (previously, the order of the ohlcv columns would be seemingly random). The failing project coverage check appears unrelated (in the login.py module, possibly related to #130, perhaps a flaky test that is aborting on not getting a connection?). Anyway, PR's ready for review. Cheers |
Adds `TestHistoryDataframe` test class.
b392d67
to
9d8fd98
Compare
Thanks for opening this @maread99 ! Appreciate all the work here! I'll have a bit more time to look into this later this week. |
Hi @dpguthrie, I know time is always an issue, although I was hoping you could give an indication as to when you think you might be in a position to look at this. |
@maread99 Apologize again for the delay here! This is 🔥 ! Thank you for contributing this; it will really help with others in really adopting this package. |
No worries @dpguthrie, thanks for merging. Given all your recent changes and this PR, will you be cutting a new release for PyPI any time soon? |
Changes dtype of index of DataFrame returned by `Ticker.history` when interval is in terms of weeks or months. Changes dtype from tz-aware 'datetime64' to 'object' that represents dates and live indice in the same manner as for a daily interval. This behaviour should have been implemented in dpguthrie#129.
Fixes:
See the referenced issues for the background.
Also, gets upwards of 2x reduction in data processing time by reducing
DataFrame
manipulations.@dpguthrie, give this a 👍 if you like the look of it and I'll add some tests! (Changes are passing the existing test suite locally.)