From 22153180cf7f77cb80e39d67a6fbceea173231c8 Mon Sep 17 00:00:00 2001 From: Adlai Chandrasekhar Date: Thu, 21 Sep 2017 16:39:49 +0300 Subject: [PATCH] fix indentations in ROI calculation --- jmclient/jmclient/wallet_utils.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/jmclient/jmclient/wallet_utils.py b/jmclient/jmclient/wallet_utils.py index aceb496..3b16e96 100644 --- a/jmclient/jmclient/wallet_utils.py +++ b/jmclient/jmclient/wallet_utils.py @@ -630,16 +630,15 @@ def wallet_fetch_history(wallet, options): def f(r, deposits, deposit_times, now, final_balance): return np.sum(np.exp((now - deposit_times) / 60.0 / 60 / 24 / 365)**r * deposits) - final_balance - r = brentq(f, a=1, b=-1, args=(deposits, deposit_times, now, - balance)) - print('continuously compounded equivalent annual interest rate = ' + - str(r * 100) + ' %') - print('(as if yield generator was a bank account)') + r = brentq(f, a=1, b=-1, args=(deposits, deposit_times, now, balance)) + print('continuously compounded equivalent annual interest rate = ' + + str(r * 100) + ' %') + print('(as if yield generator was a bank account)') except ImportError: print('numpy/scipy not installed, unable to calculate effective ' + 'interest rate') - total_wallet_balance = sum(wallet.get_balance_by_mixdepth().values()) + total_wallet_balance = sum(wallet.get_balance_by_mixdepth().values()) if balance != total_wallet_balance: print(('BUG ERROR: wallet balance (%s) does not match balance from ' + 'history (%s)') % (sat_to_str(total_wallet_balance),