From 8223d06d98d29bb09dfac0fe5a08cbbc4b6be41d Mon Sep 17 00:00:00 2001 From: Cam Sweeney Date: Tue, 23 Jan 2018 02:37:01 -0800 Subject: [PATCH] BUG: Use empyrical patches for persisting issue #126 The referenced issue was addressed via importing a set of patches for empyrical. However the same error occurs occasionally when calling the empyrical functions inside "/catalyst/finance/risk/period.py". This PR simply applies 2 of the same patches in period.py. I have only experienced problems with cum_returns and max_drawdown thus far, but it is likely the other patches may be needed. --- catalyst/finance/risk/period.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/catalyst/finance/risk/period.py b/catalyst/finance/risk/period.py index 987b8d72..2b072ea9 100644 --- a/catalyst/finance/risk/period.py +++ b/catalyst/finance/risk/period.py @@ -29,13 +29,15 @@ from .risk import check_entry from empyrical import ( alpha_beta_aligned, annual_volatility, - cum_returns, downside_risk, information_ratio, - max_drawdown, sharpe_ratio, sortino_ratio ) +from catalyst.patches.stats import ( + max_drawdown, + cum_returns, +) from catalyst.constants import LOG_LEVEL