quantopian / pyfolio

Portfolio and risk analytics in Python
https://quantopian.github.io/pyfolio
Apache License 2.0
5.7k stars 1.78k forks source link

MAINT: make pyfolio independent of SPY or FF #534

Closed eigenfoo closed 6 years ago

eigenfoo commented 6 years ago

Currently pyfolio fetches any benchmarks that you do not supply. These happen to be SPY, and the Fama-French factors.

We should relax this: pyfolio should insist that you enter a benchmark, and a set of risk factors. If you do not, it just won't perform any of the appropriate analyses.

https://github.com/quantopian/pyfolio/blob/20060a3045c4176f9a2c417a0cb993b987441885/pyfolio/tears.py#L193-L194

All this means is that lines like these just need to be removed, or raise a ValueError to tell the user to decide on a benchmark. Users can use empyrical (e.g. ep.utils.get_fama_french) to fetch SPY or FF factors, if they so wish.

This supercedes #495

twiecki commented 6 years ago

We shouldn't raise an exception but just skip any analyses that depend on benchmark or fama_french.

eigenfoo commented 6 years ago

Closed by the merged PR.