Closed eigenfoo closed 6 years ago
@twiecki @richafrank requesting review from research and engineering, ready to merge otherwise.
LGTM. One thing we should add, though, is a function that takes prices and computes correctly indexed returns which one can pass into pyfolio
.
@twiecki done
Thanks, this definitely requires engineering review. CC @richafrank
That sounds like a good solution to me.
On Fri, Jun 1, 2018 at 4:39 PM, George Ho notifications@github.com wrote:
@eigenfoo commented on this pull request.
In empyrical/utils.py https://github.com/quantopian/empyrical/pull/97#discussion_r192417144:
@@ -24,6 +24,16 @@ import pandas as pd from pandas.tseries.offsets import BDay from pandas_datareader import data as web
@twiecki https://github.com/twiecki @richafrank https://github.com/richafrank there is a known import error with pandas_datareader: it has been fixed upstream here https://github.com/pydata/pandas-datareader/pull/520, but has yet to be released in a new version. See this StackOverflow thread https://stackoverflow.com/questions/50394873/import-pandas-datareader-gives-importerror-cannot-import-name-is-list-like .
Wondering what we should do about this. Perhaps wrap it in a try-except, and raise a warning if the import fails? If we're deprecating pandas-datareader functionality anyways, it doesn't make sense to keep this line around if it raises an import error.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/quantopian/empyrical/pull/97#pullrequestreview-125194322, or mute the thread https://github.com/notifications/unsubscribe-auth/AApJmHDvFXNEj4bVyfBRWfVs4zWxUQnrks5t4VIkgaJpZM4UFLcn .
Done.
Note to self: still need to write a test for the simple_returns
function.
Not quite sure why tests are failing. The checks fail on my local machine as well, but using pdb
doesn't reproduce the error.
Any pointers @ssanderson @twiecki?
@twiecki fixed unit tests. Ready for another pass, or merging.
@eigenfoo I had one more comment on the README. Otherwise this LGTM.
Thanks @eigenfoo!
Closes #96 #89 #65 #64
Deprecates all data-fetching functionality via
pandas-datareader
, and adds asimple_returns
helper function to replace that functionality that was implicitly done in the data-fetchers.To quote the REAME:
As of early 2018, Yahoo Finance has suffered major API breaks with no stable replacement, and the Google Finance API has not been stable since late 2017 (source). In recent months it has become a greater and greater strain on the
empyrical
development team to maintain support for fetching data throughpandas-datareader
and other third-party libraries, as these APIs are known to be unstable.As a result, all
empyrical
support for data reading functionality has been deprecated and will be removed in a future version.Users should beware that the following functions are now deprecated:
empyrical.utils.cache_dir
empyrical.utils.data_path
empyrical.utils.ensure_directory
empyrical.utils.get_utc_timestamp
empyrical.utils._1_bday_ago
empyrical.utils.get_fama_french
empyrical.utils.load_portfolio_risk_factors
empyrical.utils.default_returns_func
empyrical.utils.get_symbol_returns_from_yahoo
Users should expect regular failures from the following functions, pending patches to the Yahoo or Google Finance API:
empyrical.utils.default_returns_func
empyrical.utils.get_symbol_returns_from_yahoo