From df1839b09fc550f95f825afbde2578153aa673f9 Mon Sep 17 00:00:00 2001 From: chenzheng06 Date: Tue, 6 Jun 2017 16:10:27 -0400 Subject: [PATCH 1/2] Fix annual_bill_table validation func --- bpfin/financials/financial_income.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bpfin/financials/financial_income.py b/bpfin/financials/financial_income.py index 173ee36..06ab553 100644 --- a/bpfin/financials/financial_income.py +++ b/bpfin/financials/financial_income.py @@ -500,7 +500,7 @@ def validate_annual_bill_table(annual_bill_table): if len(annual_bill_table[utility].keys()) != duration: return False for charge in annual_bill_table[utility].values(): - if not charge: + if charge is None: return False return True -- GitLab From e8b8dd6128012b6c3cf6e3dd85ffe7aee43dd1df Mon Sep 17 00:00:00 2001 From: chenzheng06 Date: Tue, 6 Jun 2017 16:13:26 -0400 Subject: [PATCH 2/2] Fix Budget return result's line item names --- bpfin/financials/financial_budget_simulator.py | 4 ++-- bpfin/tests/testdata/feature_data.py | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bpfin/financials/financial_budget_simulator.py b/bpfin/financials/financial_budget_simulator.py index 4100973..9a28e45 100644 --- a/bpfin/financials/financial_budget_simulator.py +++ b/bpfin/financials/financial_budget_simulator.py @@ -206,10 +206,10 @@ def form_budget_simulation_result(loan_list): for preference in preference_list: table_lists = [] table_lists.append(['saving_percentage']) - table_lists.append(['budget']) + table_lists.append(['Budget']) for loan in loan_list: table_lists.append([loan.get_loan_terms()['institute']]) - table_lists.append(['self_finance']) + table_lists.append(['Self Finance']) budget_simulation_result[preference] = table_lists return budget_simulation_result diff --git a/bpfin/tests/testdata/feature_data.py b/bpfin/tests/testdata/feature_data.py index 8b37a7a..3896442 100644 --- a/bpfin/tests/testdata/feature_data.py +++ b/bpfin/tests/testdata/feature_data.py @@ -691,26 +691,26 @@ growth_rate_flag = -2.0 budget_simulation_result = [ [['saving_percentage', 0.1, 0.2, 0.30000000000000004, 0.4, 0.5], [ - 'budget', 37723.783022506694, 68031.962268808478, 68031.962268808478, + 'Budget', 37723.783022506694, 68031.962268808478, 68031.962268808478, 68031.962268808478, 68031.962268808478 ], ['NYSERDA', 0.0, 0.0, 0.0, 0.0, 0.0], ['Joe Fund', 37723.783022506694, 50000.0, 50000.0, 50000.0, 50000.0], [ 'Tooraj Capital', 0.0, 18031.962268808486, 18031.962268808486, 18031.962268808486, 18031.962268808486 - ], ['self_finance', 0.0, 0.0, 0.0, 0.0, 0.0]], + ], ['Self Finance', 0.0, 0.0, 0.0, 0.0, 0.0]], [['saving_percentage', 0.1, 0.2, 0.30000000000000004, 0.4, 0.5], [ - 'budget', 37723.783022506701, 77213.635473036207, 118031.96226880848, + 'Budget', 37723.783022506701, 77213.635473036207, 118031.96226880848, 118031.96226880848, 118031.96226880848 ], ['NYSERDA', 0.0, 0.0, 0.0, 0.0, 0.0], ['Joe Fund', 37723.783022506694, 50000.0, 50000.0, 50000.0, 50000.0], [ 'Tooraj Capital', 0.0, 18031.962268808486, 18031.962268808486, 18031.962268808486, 18031.962268808486 ], [ - 'self_finance', 9.0949470177292824e-12, 9181.6732042277363, 50000.0, + 'Self Finance', 9.0949470177292824e-12, 9181.6732042277363, 50000.0, 50000.0, 50000.0 ]], [['saving_percentage', 0.1, 0.2, 0.30000000000000004, 0.4, 0.5], [ - 'budget', 52184.67464428641, 89908.457666793111, 118031.96226880848, + 'Budget', 52184.67464428641, 89908.457666793111, 118031.96226880848, 118031.96226880848, 118031.96226880848 ], ['NYSERDA', 0.0, 0.0, 0.0, 0.0, 0.0], [ 'Joe Fund', 2184.6746442864069, 39908.457666793111, 50000.0, 50000.0, @@ -718,16 +718,16 @@ budget_simulation_result = [ ], [ 'Tooraj Capital', 0.0, 0.0, 18031.962268808486, 18031.962268808486, 18031.962268808486 - ], ['self_finance', 50000.0, 50000.0, 50000.0, 50000.0, 50000.0]], + ], ['Self Finance', 50000.0, 50000.0, 50000.0, 50000.0, 50000.0]], [['saving_percentage', 0.1, 0.2, 0.30000000000000004, 0.4, 0.5], [ - 'budget', 87723.783022506686, 118031.96226880848, 118031.96226880848, + 'Budget', 87723.783022506686, 118031.96226880848, 118031.96226880848, 118031.96226880848, 118031.96226880848 ], ['NYSERDA', 0.0, 0.0, 0.0, 0.0, 0.0], ['Joe Fund', 37723.783022506694, 50000.0, 50000.0, 50000.0, 50000.0], [ 'Tooraj Capital', 0.0, 18031.962268808486, 18031.962268808486, 18031.962268808486, 18031.962268808486 - ], ['self_finance', 50000.0, 50000.0, 50000.0, 50000.0, 50000.0]] + ], ['Self Finance', 50000.0, 50000.0, 50000.0, 50000.0, 50000.0]] ] post_annual_bill = { -- GitLab