diff --git a/bpfin/financials/loan_allocation.py b/bpfin/financials/loan_allocation.py index 5962fbb5e092b69cdefe3080aace1b18b46369d2..8baaa187d40732689e8936f61625e57db4dc88d2 100644 --- a/bpfin/financials/loan_allocation.py +++ b/bpfin/financials/loan_allocation.py @@ -89,7 +89,7 @@ def loan_allocation( sum_loan_max_amount = sum(list(current_loan.max_amount for current_loan in loan_list)) if (sum_loan_max_amount + downpayment_max) <= cost: # print('\n!alert!: not financiable') - return [0] * len(loan_list) + return [0] * len(loan_list), 0 # linear programming (LP) # Set LP constrains. diff --git a/bpfin/tests/testdata/feature_data.py b/bpfin/tests/testdata/feature_data.py index 9b0981e6b3d09e55c063e1fd8b4eb6443479c7a7..f4555fd89af4aeb1f12cb26703b1763c8192f42e 100644 --- a/bpfin/tests/testdata/feature_data.py +++ b/bpfin/tests/testdata/feature_data.py @@ -768,46 +768,35 @@ historical_cagr = 0.01242283656582921 growth_rate_flag = -2.0 budget_simulation_result = [ - [['saving_percentage', 0, 0.1, 0.2, 0.30000000000000004, 0.4, 0.5], [ - 'Budget', 0.0, 37723.783022506694, 68031.962268808478, - 68031.962268808478, 68031.962268808478, 68031.962268808478 - ], ['NYSERDA', 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], - ['Joe Fund', 0.0, 37723.783022506694, 50000.0, 50000.0, 50000.0, - 50000.0], [ - 'Tooraj Capital', 0.0, 0.0, 18031.962268808486, 18031.962268808486, - 18031.962268808486, 18031.962268808486 - ], ['Self Finance', 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]], - [['saving_percentage', 0, 0.1, 0.2, 0.30000000000000004, 0.4, 0.5], [ - 'Budget', 0.0, 43031.145022506695, 87828.359268808475, - 118031.96226880848, 118031.96226880848, 118031.96226880848 - ], ['NYSERDA', 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], - ['Joe Fund', 0.0, 37723.783022506694, 50000.0, 50000.0, 50000.0, - 50000.0], [ - 'Tooraj Capital', 0.0, 0.0, 18031.962268808486, 18031.962268808486, - 18031.962268808486, 18031.962268808486 - ], [ - 'Self Finance', 0.0, 5307.3620000000001, 19796.397000000001, 50000.0, - 50000.0, 50000.0 - ]], [['saving_percentage', 0, 0.1, 0.2, 0.30000000000000004, 0.4, 0.5], [ - 'Budget', 0.0, 55957.052946537078, 97453.214271294448, - 118031.96226880848, 118031.96226880848, 118031.96226880848 - ], ['NYSERDA', 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [ - 'Joe Fund', 0.0, 5957.0529465370792, 47453.214271294455, 50000.0, - 50000.0, 50000.0 - ], [ - 'Tooraj Capital', 0.0, 0.0, 0.0, 18031.962268808486, - 18031.962268808486, 18031.962268808486 - ], ['Self Finance', 0.0, 50000.0, 50000.0, 50000.0, 50000.0, 50000.0]], - [['saving_percentage', 0, 0.1, 0.2, 0.30000000000000004, 0.4, 0.5], [ - 'Budget', 50000.0, 87723.783022506686, 118031.96226880848, - 118031.96226880848, 118031.96226880848, 118031.96226880848 - ], ['NYSERDA', 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], - ['Joe Fund', 0.0, 37723.783022506694, 50000.0, 50000.0, 50000.0, 50000.0], - [ - 'Tooraj Capital', 0.0, 0.0, 18031.962268808486, 18031.962268808486, - 18031.962268808486, 18031.962268808486 - ], ['Self Finance', 50000.0, 50000.0, 50000.0, 50000.0, 50000.0, 50000.0]] -] + [ + ['saving_percentage', 0, 0.1, 0.2, 0.30000000000000004, 0.4, 0.5], + ['Budget', 0.0, 38401.46572920159, 69293.66516557403, 69293.66516557403, 69293.66516557403, 69293.66516557403], + ['NYSERDA', 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + ['Joe Fund', 0.0, 38401.46572920159, 50000.0, 50000.0, 50000.0, 50000.0], + ['Tooraj Capital', 0.0, 0.0, 19293.665165574028, 19293.665165574028, 19293.665165574028, 19293.665165574028], + ['Self Finance', 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]], + [ + ['saving_percentage', 0, 0.1, 0.2, 0.30000000000000004, 0.4, 0.5], + ['Budget', 0.0, 43708.82772920159, 89090.06216557403, 119293.66516557403, 119293.66516557403, 119293.66516557403], + ['NYSERDA', 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + ['Joe Fund', 0.0, 38401.46572920159, 50000.0, 50000.0, 50000.0, 50000.0], + ['Tooraj Capital', 0.0, 0.0, 19293.665165574028, 19293.665165574028, 19293.665165574028, 19293.665165574028], + ['Self Finance', 0.0, 5307.362, 19796.397, 50000.0, 50000.0, 50000.0]], + [ + ['saving_percentage', 0, 0.1, 0.2, 0.30000000000000004, 0.4, 0.5], + ['Budget', 0.0, 56064.06744617847, 98305.67974830023, 119293.66516557403, 119293.66516557403, 119293.66516557403], + ['NYSERDA', 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + ['Joe Fund', 0.0, 6064.06744617847, 48305.67974830022, 50000.0, 50000.0, 50000.0], + ['Tooraj Capital', 0.0, 0.0, 0.0, 19293.665165574028, 19293.665165574028, 19293.665165574028], + ['Self Finance', 0.0, 50000.0, 50000.0, 50000.0, 50000.0, 50000.0]], + [ + ['saving_percentage', 0, 0.1, 0.2, 0.30000000000000004, 0.4, 0.5], + ['Budget', 50000.0, 88401.46572920159, 119293.66516557403, 119293.66516557403, 119293.66516557403, 119293.66516557403], + ['NYSERDA', 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + ['Joe Fund', 0.0, 38401.46572920159, 50000.0, 50000.0, 50000.0, 50000.0], + ['Tooraj Capital', 0.0, 0.0, 19293.665165574028, 19293.665165574028, 19293.665165574028, 19293.665165574028], + ['Self Finance', 50000.0, 50000.0, 50000.0, 50000.0, 50000.0, 50000.0]] + ] post_annual_bill = { UTILITY_TYPE_LIST[0]: { diff --git a/setup.py b/setup.py index bb10cb66477e7adb8cbfcf41efb6c53ec72de0d0..cf54941c6acad6fb81e87368cf0920622f06553a 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ reqs = [str(req.req) for req in install_reqs] setup( name='bpfin', - version='0.2.6', + version='0.2.7', description='Finance models and utilites', author='BlocPower', author_email='admin@blocpower.org',