diff --git a/bpfin/financials/financial_lib.py b/bpfin/financials/financial_lib.py index 8a840dae405c4aa605ad8274eb5935d030975d7b..4479bcfd1dfbe3050972add924cbf8d778e80c59 100644 --- a/bpfin/financials/financial_lib.py +++ b/bpfin/financials/financial_lib.py @@ -1,12 +1,8 @@ -import datetime -import calendar import copy from bpfin.lib import other as lib from bpfin.utilbills.bill_lib import form_bill_year from numpy import mean -from bpfin.tests.testdata import sample_data as db - -# import bpfin.utilbills.bill_lib as bl +# from bpfin.tests.testdata import sample_data as db # import pprint @@ -375,7 +371,6 @@ class Income_Statement_Table(): year, last_revenue, growth_rate_flag, self.characters, annual_bill_table) current_table.append(current_income_statement) - # print(current_income_statement.revenue, current_income_statement.noi) self.table = current_table return current_table @@ -691,6 +686,8 @@ class Balance_Sheet_Table(): # test_2 = test_stru(3.0) # test_3 = test_stru(5.0) - # test_list = [test_1, test_2, test_3] - # form_list = list(ob.number for ob in test_list) - # print(form_list) +# test_list = [test_1, test_2, test_3] +# form_list = list(ob.number for ob in test_list) +# print(form_list) + + diff --git a/bpfin/financials/loan.py b/bpfin/financials/loan.py new file mode 100644 index 0000000000000000000000000000000000000000..7b3489718d0d8880e0981c376d7a9d1c0c470cc2 --- /dev/null +++ b/bpfin/financials/loan.py @@ -0,0 +1,214 @@ +import copy +from bpfin.utilbills.bill_lib import form_bill_calendar +from bpfin.financials.loan_allocation import loan_allocation + + +class Loan(): + """ + Single loan, with terms and schedule + Attributes: + institute (string): name of loan lender + max_amount (float): upper limit of loan amount that can be borrowed + interest (float): annual interest rate. 0.025 = 2.5% + duration (int): loan duration scheduled be repaid, in month + payback (float): ratio of (loan amount/annual debt service), similar to but NOT the payback period, in year + amount (float): amount borrowed or suggested to be borrowed from this lender + debt_service (float): monthly debt service need to be paid. Now we use amortization calculation + terms (list): list of datetime.date, the months that scheduled to get repay. Dates are end of month + principal_start_balance (list): list of float, begining balance of schedule outstanding principal + principal_end_balance (list): list of float, ending balance of schedule outstanding principal + interest_due (list): list of float, scheduled interest repayment due + principal_due (list): list of float, scheduled principal repayment due + debt_service_due (list): list of float, scheduled interest + principal repayment due + """ + def __init__(self, loan_term): + """ + Initiate a single loan, with inputs of basic terms, and calculate payback as a key character + Args: + loan_term (dictionary): characters of a loan. + Description: + loan_term = {'institute': 'NYSERDA', 'max_amount': 5000.00, 'interest': 0.08, 'duration': 120} + To Do: + verify interest rate != 0 + """ + self.institute = loan_term['institute'] + self.max_amount = loan_term['max_amount'] + self.interest = loan_term['interest'] + self.duration = loan_term['duration'] # in month + self.payback = ((1 + self.interest) ** (self.duration / 12) - 1) / (self.interest * ( + 1 + self.interest) ** (self.duration / 12)) + self.amount = 0 + self.debt_service = 0 + self.terms = [] + self.principal_start_balance = [] + self.principal_end_balance = [] + self.interest_due = [] + self.principal_due = [] + self.debt_service_due = [] + + def get_loan_terms(self): + """ + Get loan terms in dictionary format. + Return: + dictionary: a dict containing all characters, not schedule + """ + return { + 'institute': self.institute, + 'max_amount': self.max_amount, + 'interest': self.interest, + 'duration': self.duration, + 'payback': self.payback, + 'terms': self.terms, + 'amount': self.amount, + 'debt_service': self.debt_service} + + def put_amount(self, amount): + """ + Put loan amount to loan amount, calculate monthly debt service. + Args: + amount (float): loan amount that calculated or suggested to borrow + """ + self.amount = amount + self.debt_service = self.amount * ((self.interest / 12) * (1 + self.interest / 12) ** (self.duration)) / ( + (1 + self.interest / 12) ** (self.duration) - 1) + + def put_terms(self, loan_start_date): + """ + Put loan start date and calculate schedule terms. + Args: + loan_start_date(datetime.date): the date that the loan will be deployed + """ + self.terms = form_bill_calendar(loan_start_date, float(self.duration)/12)[1] + + def originate(self): + """ + Origniate loan, calculating its schedule + Note: + if amount == 0, but terms != None, the schedule will still be calculated + if terms == None, the function returns None + """ + if not self.terms: + # print('missing start_data') + return None + debt_service = self.debt_service + principal_start_balance = [] + principal_end_balance = [] + interest_due = [] + principal_due = [] + debt_service_due = [] + + start_balance = self.amount + for termID in self.terms: + interest_amount = start_balance * self.interest / 12 + principal_amount = debt_service - interest_amount + principal_start_balance.append(start_balance) + interest_due.append(interest_amount) + debt_service_due.append(debt_service) + principal_due.append(principal_amount) + principal_end_balance.append( + start_balance - principal_amount if (start_balance - principal_amount) >= 10e-5 else 0) + start_balance = start_balance - principal_amount + self.principal_start_balance = principal_start_balance + self.principal_end_balance = principal_end_balance + self.interest_due = interest_due + self.principal_due = principal_due + self.debt_service_due = debt_service_due + + +class Loan_List(): + """ + Create a list of loan objects, in order to allocate loan amount among loans, and calculate schedules for loans + Attributes: + loan_list (list): list of loan objects + """ + def __init__(self, loan_input_list): + """ + Initiate loan_list with inputs. + Args: + loan_input_list (list): list of dictionary of loan basic terms. + """ + self.loan_list = [] + for current_loan in loan_input_list: + temp_loan = None + temp_loan = Loan(current_loan) + self.loan_list.append(temp_loan) + + def allocate(self, customer_preference, scenario, req_dscr, first_year_saving, first_year_noi, first_year_cash): + """ + Allocate loan amount based on project cost, loan terms, income statements, scenario, other requirements. + Apply linear programming method to allocate loan amount among loans, create financing plan. + Args: + customer_preference (dictionary): dict of customer preference, { + 'downpayment_max': float, upper limit of self finance amount, + 'expected_payback': int, months that customer expect the project can payback, + 'cust_saving_dscr': float, customer required lower limit of (saving / debt service) ratio + } + scenario (dictionary): dict of project economics and saving scenario, { + 'cost_estimation': float, estimated project cost + 'post_income_statement': objective of Income_Statement_Table , projected income_statement with savings + } + req_dscr (dictionary): dict of required debt service coverage ratios, { + 'req_noi_dscr': 1.15, + 'req_cash_dscr': 1.15, + 'req_saving_dscr': 1.10 + } + first_year_saving (float): first year saving. # maybe it can be min_annual_saving + first_year_noi (float): first year noi, after commissioning date. # maybe it can be min_noi + first_year_cash (float): first year cash, after commissioning date + Returns: + list: list of Loan objects, with amount assigned, no schedule assigned + """ + current_loan_list = copy.deepcopy(self.loan_list) + allocation = loan_allocation(current_loan_list, customer_preference, + scenario, req_dscr, first_year_saving, + first_year_noi, first_year_cash) + for current_loan, current_amount in zip(current_loan_list, allocation): + current_loan.put_amount(current_amount) + return current_loan_list + + def get_schedule(self, customer_preference, scenario, req_dscr, + loan_start_date, first_year_saving, first_year_noi, + first_year_cash): + """ + Get the schedule of all loans, after allocating loan amounts + Args: + customer_preference (dictionary): dict of customer preference, { + 'downpayment_max': float, upper limit of self finance amount, + 'expected_payback': int, months that customer expect the project can payback, + 'cust_saving_dscr': float, customer required lower limit of (saving / debt service) ratio + } + scenario (dictionary): dict of project economics and saving scenario, { + 'cost_estimation': float, estimated project cost + 'post_income_statement': objective of Income_Statement_Table , projected income_statement with savings + } + req_dscr (dictionary): dict of required debt service coverage ratios, { + 'req_noi_dscr': 1.15, + 'req_cash_dscr': 1.15, + 'req_saving_dscr': 1.10 + } + loan_start_date (date): the date when loan starts. Usually is when construction starts + first_year_saving (float): first year saving. # maybe it can be min_annual_saving + first_year_noi (float): first year noi, after commissioning date. # maybe it can be min_noi + first_year_cash (float): first year cash, after commissioning date + + Returns: + list: list of Loan objects, with amounts and schedules assigned + """ + allocated_loan_list = self.allocate(customer_preference, scenario, + req_dscr, first_year_saving, + first_year_noi, first_year_cash) + for current_loan in allocated_loan_list: + current_loan.put_terms(loan_start_date) + current_loan.originate() + return allocated_loan_list + + +# ****** ugly tests Loan and Loan_List class ********** +# loan_list = Loan_List(db.loan_input_list) +# allocated = loan_list.get_schedule( +# db.customer_preference, +# db.scenario, +# db.req_dscr, +# datetime.date(2017, 1, 12)) +# print(allocated[0].terms) +# print(allocated[0].principal_end_balance) diff --git a/bpfin/financials/loan_allocation.py b/bpfin/financials/loan_allocation.py new file mode 100644 index 0000000000000000000000000000000000000000..c0d8149dcc89d032fb05e701ee8f1e8e183a1c8f --- /dev/null +++ b/bpfin/financials/loan_allocation.py @@ -0,0 +1,165 @@ +from scipy.optimize import linprog + + +def loan_allocation( + loan_list, + customer_preference, + scenario, + req_dscr, + first_year_saving, + first_year_noi, + first_year_cash): + """ + Take inputs of available financing options(loans and self-finance), and other constrains, + determine the best financing plan, with minimum debt service. + Run a linear programming (LP) to determine the result, which is how much to borrow from each lender + Math process is as following: + **** pre-request is: + quoted_cost <= sum_loan_max_amount + downpayment_max + **** LP constrains are: + 1. objective function, determine minimum annual total DS. + x1/payback1, x2/payback2, x3/payback3 = minimum + * x is loan amount, no self-finance + 2. x variables constraint + x1 + x2 + x3 <= max + max = min(project_cost, sum_loan_max_amount, saving/dscr, noi/dscr, cash/dscr) + * default assumption is customer wants to self-finance but use loan first + self-finance amount = project_cost - sum_x + ** if customer wants to use self-fiance first, then + project_cost = quoted_cost - self_finance_max + 3. x variables bounds + 0 <= x[i] <= loan[i]_max_amount + + Args: + loan_list (list): list of objectives of loans + customer_preference (dictionary): customer preference for financing plan + req_dscr(dictionary): required dscr + scenario (dictionary): package of energy conservation measures (ECMs) + first_year_saving (float): first year saving. # maybe it can be min_annual_saving + first_year_noi (float): first year noi, after commissioning date. # maybe it can be min_noi + first_year_cash (float): first year cash, after commissioning date + # liability: do we need this? it's already calculated in balance sheet + # commissioning_date (date): construction finish date. Saving start at NEXT month + Return: + list: list of loan amount that borrowed from each lender + + Description: + customer_preference (dictionary): dict of customer preference, { + 'downpayment_max': float, upper limit of self finance amount, + 'expected_payback': int, months that customer expect the project can payback, + 'cust_saving_dscr': float, customer required lower limit of (saving / debt service) ratio + } + scenario (dictionary): dict of project economics and saving scenario, { + 'cost_estimation': float, estimated project cost + 'post_income_statement': objective of Income_Statement_Table , projected income_statement with savings + } + req_dscr (dictionary): dict of required debt service coverage ratios, { + 'req_noi_dscr': 1.15, + 'req_cash_dscr': 1.15, + 'req_saving_dscr': 1.10 + } + Note: + noi == net operating income + dscr == debt service coverage ratio + + To do: calculate self_finance amount + if customer wants to self-finance, but loan first -> SF = cost - sum(xi) + if customer wants to S-F, but SF first -> max(xi) = cost - SF_max + """ + sum_loan_max_amount = sum(list(current_loan.max_amount for current_loan in loan_list)) + print('\n sum_loan_max_amount=', sum_loan_max_amount) + # pre-request judge: project cost should be lower than total available financing + if (sum_loan_max_amount + customer_preference['downpayment_max']) <= scenario['cost_estimation']: + print('alert: not financiable') + return None + + # linear programming (LP) + # Set LP constrains. + # objective function: x1/payback1, x2/payback2, x3/payback3 = minimum + c = list(1 / current_loan.payback for current_loan in loan_list) + # x variables constraint, x1 + x2 + x3 >= max (financing amount >= project cost) + # max = min(project_cost, sum_loan_max_amount, saving/dscr, noi/dscr, cash/dscr) + A = [] + A.append([-1] * len(loan_list)) # -x1 -x2 -x3 <= -max + b = [] + b.append( + 0 - scenario['cost_estimation'] + # 0 - sum_loan_max_amount, + ) + A.append(c) # sum(x_i/payback_i) <= required. aka. sum(debt_service) <= min_required_debt_service + b.append(min( + first_year_saving / req_dscr['req_saving_dscr'], + first_year_noi / req_dscr['req_noi_dscr'], + first_year_cash / req_dscr['req_cash_dscr'] + # 0 - first_year_noi / customer_preference['cust_saving_dscr'], + )) + # x variables bounds, 0 <= x[i] <= loan[i]_max_amount + bound_list = list((0, current_loan.max_amount) for current_loan in loan_list) + # LP calculation. x[i] == loan amount from loan[i] + res = linprog(c, A_ub=A, b_ub=b, bounds=bound_list, options={'disp': False}) + return res.x + + +# ******** the following is draft for old work, for budge calculator development ******** + +# ## LP function, return total budget and variables +# def budget_LP(Financial_list,Loan_list,saving_percentage,other_loan,exp_pb,SF_fin,is_loan_first,saving_contigency,min_DSCR): +# # loan information ************* +# other_loan_DS=other_loan +# loan_max_list=[] +# ratio_list=[] +# DSmax_list=[] +# for loan in Loan_list: +# loan_max_list.append(loan.max_amount) +# ratio=cal_loan_payback(loan.interest,loan.duration) +# ratio_list.append(ratio) +# DSmax_list.append(loan.max_amount/ratio) +# DSmax=sum(DSmax_list) + +# # client preference ************* +# ratio_SF=exp_pb #expected payback period for self finance +# # is_loan_first = does client want to reduce loan by self-finance +# # willingtopay = max amount that the client can/want to self-finance + +# # financial and savings ************* +# noi=average([Financial_list[0].noi,Financial_list[1].noi,Financial_list[2].noi]) +# savings=average([Financial_list[0].energy_opex,Financial_list[1].energy_opex,Financial_list[2].energy_opex])*saving_percentage + +# ## object formula and conditions ********************************** +# c =[-1]*(len(Loan_list)+1) + +# a_base=[] +# for ratio in ratio_list: +# a_base.append(1/ratio) +# a1=[] +# a2=[] +# for pp in a_base: +# a1.append(pp) +# a2.append(pp) +# a1.append(1/ratio_SF) +# a2.append(0) +# a3=[0]*(len(Loan_list)+1) +# a3[-1]=1 + +# A =[ +# a1, +# a2, +# a3 +# ] +# b =[ +# savings/saving_contigency, +# ((noi+savings)/min_DSCR-other_loan_DS), +# SF_fin +# ] + +# bound_list=[] +# for loan_max in loan_max_list: +# bound_list.append((0,loan_max)) +# bound_list.append((0,(max(savings-DSmax,0)*ratio_SF if is_loan_first==True else None))) +# bounds=bound_list + +# res = linprog(c,A_ub=A,b_ub=b,bounds=bounds,options={'disp':False}) +# # print('Max_Budget',-res.fun) +# # print(res.x) +# # print('\n') +# return [-res.fun,res.x] diff --git a/bpfin/financials/saving.py b/bpfin/financials/saving.py index 02aa18ea4d719fdbd734f0e990b21b8ffbaef660..befb92a217b967b934179108348b6ab6a5ff53fd 100644 --- a/bpfin/financials/saving.py +++ b/bpfin/financials/saving.py @@ -4,7 +4,7 @@ from bpfin.utilbills.bill_lib import cal_last_day from bpfin.utilbills.bill_lib import annualizing_projection from bpfin.utilbills.bill_lib import form_year_calendar from bpfin.utilbills.bill_lib import form_bill_calendar -from bpfin.tests.testdata import sample_data as db +# from bpfin.tests.testdata import sample_data as db from bpfin.utilbills.bill_post_proj_rough import bill_post_proj_rough diff --git a/bpfin/prelim/prelimfuncs.py b/bpfin/prelim/prelimfuncs.py index d6b688bdfc891a775ff9b175cc3305dfd8aedf2d..708f0d03fccd668602ab921276bf3a7d4eedef28 100644 --- a/bpfin/prelim/prelimfuncs.py +++ b/bpfin/prelim/prelimfuncs.py @@ -236,7 +236,7 @@ matplotlib.use('TkAgg') # c_base.append( # 1 / loan.payback) # loan amount / ratio = DS, targeting minimum total DS, equivalent to longest payback # bound_list.append((0, loan.max_amount)) -# c = c_base # c_base is target function +# c = c_base # c_base is the target function in linear programming # A = [-1] * len(loan_list) # b = [max(0 - total_cost, 0 - sum_loan_max)] # bounds = bound_list @@ -245,9 +245,7 @@ matplotlib.use('TkAgg') # res = linprog(c, A_ub=A, b_ub=b, bounds=bounds, options={'disp': False}) # for i in range(len(loan_list)): # loan_list[i].amount = res.x[i] - - -# # return res.x +# # return res.x # ##maybe we can use this, maybe not # # def transpose_matrix(matrix1): diff --git a/bpfin/tests/test_financials/test_financial_lib.py b/bpfin/tests/test_financials/test_financial_lib.py index 0799fdb84f7dfcb843c1e04f40ec170bae9be874..f853cc71bf43acfecc55b9409217bcb0b3245f5d 100644 --- a/bpfin/tests/test_financials/test_financial_lib.py +++ b/bpfin/tests/test_financials/test_financial_lib.py @@ -1,6 +1,7 @@ import datetime import bpfin.financials.financial_lib as fl from bpfin.tests.testdata import sample_data as db +from bpfin.financials.loan import Loan_List from bpfin.financials.financial_lib import Income_Statement_Table from bpfin.financials.financial_lib import Balance_Sheet_Table @@ -38,6 +39,29 @@ def test_Income_Statement_Table(): assert IS_table.get_first_year_noi(datetime.date(2017, 3, 14)) == output_first_year_noi +def test_Loan_List(): + """ + test Loan and Loan_List classes. + by calling Loan_List.get_schedule(), all calculation functions are called and tested. + """ + input_loan_input_list = db.loan_input_list + input_customer_preference = db.customer_preference + input_scenario = db.scenario + input_req_dscr = db.req_dscr + input_loan_start_date = datetime.date(2017, 1, 12) + output_loan1_end_balance = db.loan1_end_balance + sample_loan_list = Loan_List(input_loan_input_list) + result_loan_list = sample_loan_list.get_schedule( + input_customer_preference, + input_scenario, + input_req_dscr, + input_loan_start_date, + 28000.0, + 28000.0, + 100000.0) + assert output_loan1_end_balance == result_loan_list[0].principal_end_balance + + def test_Balance_Sheet_Table(): input_raw_balance_sheet = db.raw_balance_sheet output_hist_balance_sheet_table = db.hist_balance_sheet diff --git a/bpfin/tests/testdata/sample_data.py b/bpfin/tests/testdata/sample_data.py index 6396755f0413152df26f5fc7e7d70a0be407010b..1f1c41fa36a566f93a783bcb1eb1f914476fdf11 100644 --- a/bpfin/tests/testdata/sample_data.py +++ b/bpfin/tests/testdata/sample_data.py @@ -527,6 +527,78 @@ liability_dictionary = { 2017: 10000, 2018: 5000 } + +# Loan Options +loan_term_1 = {'institute': 'NYSERDA', 'max_amount': 500000, 'interest': 0.08, 'duration': 120} +loan_term_2 = {'institute': 'Joe Fund', 'max_amount': 50000, 'interest': 0.05, 'duration': 108} +loan_term_3 = {'institute': 'Tooraj Capital', 'max_amount': 75000, 'interest': 0.07, 'duration': 114} +loan_term_dict = {1: loan_term_1, 2: loan_term_2, 3: loan_term_3} +loan_input_list = [loan_term_1, loan_term_2, loan_term_3] + +req_dscr = { + 'req_noi_dscr': 1.15, + 'req_cash_dscr': 1.15, + 'req_saving_dscr': 1.10 +} + +# Customer Preference +customer_preference = { + 'downpayment_max': 5000.00, + 'expected_payback': 120, # in months + 'cust_saving_dscr': 1.15 +} + +# Engineering Scenarios +scenario = { + 'cost_estimation': 150000.00, + # 'saving': saving_dict, + # 'post_income_statement': post_income_statement +} + + +# Financing plan +loan1_end_balance = [ + 24863.347680778272, 24725.784346095064, 24587.303922513969, + 24447.900296109001, 24307.567312194667, 24166.298775054238, + 24024.088447666207, 23880.930051428921, 23736.817265883386, + 23591.743728434216, 23445.703034068716, 23298.688735074113, + 23150.694340752878, 23001.713317136171, 22851.73908669535, + 22700.765028051592, 22548.78447568354, 22395.790719633034, + 22241.77700520886, 22086.736532688523, 21930.66245701805, + 21773.547887509776, 21615.385887538112, 21456.169474233306, + 21295.891618173133, 21134.54524307256, 20972.123225471318, + 20808.618394419398, 20644.023531160467, 20478.331368813142, + 20311.534592050168, 20143.625836775442, 19974.597689798884, + 19804.442688509149, 19633.153320544148, 19460.722023459381, + 19287.141184394048, 19112.403139734946, 18936.500174778117, + 18759.424523388243, 18581.16836765577, 18401.723837551748, + 18221.083010580365, 18039.237911429173, 17856.180511616974, + 17671.902729139361, 17486.396428111897, 17299.653418410915, + 17111.665455311926, 16922.424239125612, 16731.921414831388, + 16540.148571708534, 16347.097242964863, 16152.758905362902, + 15957.124978843593, 15760.186826147488, 15561.93575243341, + 15362.363004894572, 15161.459772372142, 14959.217184966228, + 14755.626313644276, 14550.678169846844, 14344.363705090762, + 14136.673810569639, 13927.599316751708, 13717.130992974991, + 13505.259547039763, 13291.9756247983, 13077.269809741894, + 12861.132622585112, 12643.554520847285, 12424.525898431206, + 12204.037085199019, 11982.078346545284, 11758.639882967193, + 11533.711829631913, 11307.284255941066, 11079.347165092278, + 10849.890493637833, 10618.904111040358, 10386.377819225565, + 10152.301352132008, 9916.6643752578275, 9679.4564852044859, + 9440.667209217454, 9200.2860047238428, 8958.302258866941, + 8714.7052880376596, 8469.4843374028496, 8222.6285804304734, + 7974.1271184116158, 7723.9689799792986, 7472.1431206240995, + 7218.6384222065326, 6963.4436924661813, 6706.5476645275612, + 6447.9389964026841, 6187.6062704903079, 5925.5379930718491, + 5661.7225938039337, 5396.1484252075652, 5128.8037621538879, + 4859.6768013465198, 4588.7556608004352, 4316.0283793173767, + 4041.4829159577648, 3765.1071495090891, 3486.8888779507552, + 3206.8158179153656, 2924.8756041464071, 2641.055788952322, + 2355.3438416569434, 2067.7271480462618, 1778.1930098115092, + 1486.7286439885249, 1193.3211823933875, 897.9576710542824, + 600.62506963958322, 301.31025088211942, 0] + # {year: value, is_balancesheet (boolean)} cash_balance = { 2014: 5000.0, 2015: 6000, 2016: 4500.0 diff --git a/bpfin/utilbills/bill_lib.py b/bpfin/utilbills/bill_lib.py index 57001fbb52532674cdbd77a1c744e20de627b7c8..693e539e822911907517fd4a051cd03bf09d315c 100644 --- a/bpfin/utilbills/bill_lib.py +++ b/bpfin/utilbills/bill_lib.py @@ -42,7 +42,7 @@ def form_bill_calendar(date_start, year_term): bdstart = [] bdend = [] day = date_start - for term in range(12 * year_term): + for term in range(int(12 * year_term)): first = datetime.date(day=1, month=day.month, year=day.year) bdstart.append(first) last = datetime.date(day.year, day.month, cal_last_day(day.year, day.month)) diff --git a/bpfin/utilbills/data_generation.py b/bpfin/utilbills/data_generation.py index d4552bbbdbc1a3a48d8b2425d0f80e04fb5baa3d..d3a2bdeb0135c1accb4945e6e3458cdc948340a5 100644 --- a/bpfin/utilbills/data_generation.py +++ b/bpfin/utilbills/data_generation.py @@ -1,12 +1,10 @@ -# import datetime -# import copy # from bpfin.utilbills.bill_month_normalize_rough import bill_month_normalize_rough # from bpfin.utilbills.bill_prior_proj_rough import bill_prior_proj_rough -# from bpfin.financials.saving import Saving -# from bpfin.lib import other as lib # from bpfin.utilbills import bill_lib as bl -# from bpfin.financials import financial_lib as fl # from bpfin.tests.testdata import sample_data as db +# import bpfin.financials.financial_lib as fl +# import bpfin.lib.other as lib +# import copy # raw_bill = db.raw_bill @@ -14,8 +12,6 @@ # prior_bill_electricity = bill_prior_proj_rough(norm_bill, raw_bill, db.analysis_date, db.inflation_coeff_dict) # annual_bill_electricity = bl.annualizing_projection(prior_bill_electricity['date_to'], prior_bill_electricity['charge']) -# print(annual_bill_electricity) - # prior_energy_bill = db.bill_overview_organized # raw_income_input = db.raw_income_input