From 9a7da9bebf8776125c8226f3e04dd98e35d4e91f Mon Sep 17 00:00:00 2001 From: chenzheng06 Date: Tue, 25 Apr 2017 10:47:22 -0400 Subject: [PATCH 1/4] Create bill-post-proj-rough Minor formmating --- .../test_bill_post_proj_rough.py | 0 bpfin/tests/testdata/sample_data.py | 2 +- bpfin/utilbills/bill_post_proj_rough.py | 26 +++++++++++++++++++ bpfin/utilbills/bill_prior_proj_rough.py | 6 +++-- 4 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 bpfin/tests/test_utilbills/test_bill_post_proj_rough.py create mode 100644 bpfin/utilbills/bill_post_proj_rough.py diff --git a/bpfin/tests/test_utilbills/test_bill_post_proj_rough.py b/bpfin/tests/test_utilbills/test_bill_post_proj_rough.py new file mode 100644 index 0000000..e69de29 diff --git a/bpfin/tests/testdata/sample_data.py b/bpfin/tests/testdata/sample_data.py index bd9127b..a13c5d0 100644 --- a/bpfin/tests/testdata/sample_data.py +++ b/bpfin/tests/testdata/sample_data.py @@ -1,6 +1,6 @@ import datetime import pprint -from bpfin.utilbills import bill_lib as bl +# from bpfin.utilbills import bill_lib as bl # pp = pprint.PrettyPrinter(width=120, indent=4, compact=True) # pp.pprint(inflation_coeff_dict) diff --git a/bpfin/utilbills/bill_post_proj_rough.py b/bpfin/utilbills/bill_post_proj_rough.py new file mode 100644 index 0000000..043d499 --- /dev/null +++ b/bpfin/utilbills/bill_post_proj_rough.py @@ -0,0 +1,26 @@ +import datetime +import bpfin.utilbills.bill_lib as bl +import bpfin.lib.other as lib + + +def bill_post_proj_rough(prior_bill, saving_percent): + """ + Project energy bill, on a monthly_normalized base, + with daily rough estimation, for years that in the past and future, + for one utility type, with savings + + Args: + prior_bill (dictionary): dictionary of lists + {'date_from': prior_bill_start, 'date_to': prior_bill_end, + 'usage': prior_monthly_usage, 'charge': prior_monthly_charge, + 'price': prior_monthly_price} + saving_percent (float): percentage savings. can be negative value + Return: + dictionary: post_bill: dictionary of lists + {'date_from': post_bill_start, 'date_to': post_bill_end, + 'usage': post_monthly_usage, 'charge': post_monthly_charge, + 'price': post_monthly_price} + """ + + + diff --git a/bpfin/utilbills/bill_prior_proj_rough.py b/bpfin/utilbills/bill_prior_proj_rough.py index 9531720..363bc9f 100644 --- a/bpfin/utilbills/bill_prior_proj_rough.py +++ b/bpfin/utilbills/bill_prior_proj_rough.py @@ -4,8 +4,10 @@ import bpfin.lib.other as lib def bill_prior_proj_rough(month_norm_bill, raw_bill, analysis_date, inflation_coeff_dict): - """ project energy bill, on a monthly_normalized base, - with daily rough estimation, for years that in the past and future + """ + Project energy bill, on a monthly_normalized base, + with daily rough estimation, for years that in the past and future, + for one utility type, without savings Args: month_norm_bill (dictionary): {'monthly_usage':[list of float], -- GitLab From 494fa8ad5989110e22681a4257090908d25b8a81 Mon Sep 17 00:00:00 2001 From: chenzheng06 Date: Tue, 25 Apr 2017 11:15:37 -0400 Subject: [PATCH 2/4] Create bill_post_proj_rough file, and sample data Need to create test file --- bpfin/lib/other.py | 8 + bpfin/tests/testdata/sample_data.py | 201 ++++++++++++++++++++++++ bpfin/utilbills/bill_post_proj_rough.py | 19 +++ 3 files changed, 228 insertions(+) diff --git a/bpfin/lib/other.py b/bpfin/lib/other.py index 415d57e..d7754f8 100644 --- a/bpfin/lib/other.py +++ b/bpfin/lib/other.py @@ -229,6 +229,14 @@ def sublist(list1, list2): def multiply_list(obj_list, number): + """ + Multiply a number on every element in a list + Args: + obj_list (list): a list of float values + number (float): a float number + Return: + list: list of productions + """ return [x * number for x in obj_list] diff --git a/bpfin/tests/testdata/sample_data.py b/bpfin/tests/testdata/sample_data.py index a13c5d0..a30071a 100644 --- a/bpfin/tests/testdata/sample_data.py +++ b/bpfin/tests/testdata/sample_data.py @@ -1013,9 +1013,210 @@ prior_proj_rough_price = [ 42131.00318614885, 40054.83089682108, 40079.848368848034, 40883.798098440246, 40432.470041231565, 40779.34931771414, 41139.21219179594, 40321.43463472525, 43237.085994998866, 48437.35375945405, 51641.29962190506, 48278.23252154697] +prior_bill_rough = { + 'date_from': proforma_date_from, + 'date_to': proforma_date_to, + 'usage': prior_proj_rough_usage, + 'charge': prior_proj_rough_charge, + 'price': prior_proj_rough_price + } + +post_proj_rough_usage = [ + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, + 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, + 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, + 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, + 0.02486516252818199, 0.02326718923407694, 0.023677584957960417] + +post_proj_rough_charge = [ + 619.7338063825013, 517.6961472770894, 612.575579894746, 622.6014776448455, + 640.177401561794, 693.8343843706216, 807.7298046310648, 667.1440373717153, + 618.3452279436626, 765.3044032694584, 763.5441724234088, 726.4612062835487, + 632.4017898476586, 528.0094654879673, 624.4610100349538, 634.3583584940408, + 651.9341500379039, 706.2168613008313, 821.7264085588018, 678.3590405425609, + 628.4198491014146, 777.3774971909082, 775.1946948077268, 737.1704616469825, + 641.8021126637518, 535.9228998436387, 633.8966965333259, 644.021524611271, + 661.9451460205818, 717.1481919198758, 834.5466624946462, 689.0259080250906, + 638.3786935752709, 789.792507056883, 787.6701560166625, 749.1246338013683, + 651.3924455459943, 543.2494702738874, 641.7574320750956, 651.1907495590884, + 668.4751438201633, 723.3151987306153, 840.6684121816988, 693.210413737602, + 641.4507708553485, 792.598741594428, 789.4782716837934, 749.9033450551117, + 652.8204664526241, 545.0673733693849, 644.6464770277669, 654.8755267300367, + 673.0318749009425, 729.0843765577026, 848.3494092457953, 700.3496923314983, + 648.8032650257538, 802.6069300049104, 800.3676745651898, 761.1223596967588, + 663.0761630251832, 554.0389603728976, 655.7407861953105, 666.6376053757109, + 685.6257904042336, 743.2754167695899, 865.5002617275202, 715.0359024463258, + 662.8975252646267, 820.6476700902451, 818.9621681960866, 779.3799789252683, + 679.0767436551412, 567.4876628067063, 671.752038117678, 683.0103448299104, + 702.563034103321, 761.7432172374953, 887.1288587196315, 733.0068434868094, + 679.6530269584892, 841.5080513656536, 839.8970421483878, 799.4147073358783, + 696.4112693043891, 581.8719223648512, 688.6586608142767, 700.0778652073503, + 719.9932159518671, 780.505106753889, 908.8200599491014, 750.7982826155337, + 696.0277273225649, 861.6315737181612, 859.8316459836717, 818.2453603933521, + 712.8008574792484, 595.5535671550497, 704.8366014408282, 716.50922625304, + 736.8767445863571, 798.7910698522899, 930.0929709381013, 768.3564372469455, + 712.2902670894705, 881.7451509972124, 879.8849838794788, 837.3114653915807, + 729.1901552366594, 609.0634103746377, 720.6082413090635, 732.3212894453297, + 752.9113080727479, 815.9269287882317, 949.7592338200635, 784.3664207577789, + 726.9128822745962, 899.5753198556371, 897.4070035078757, 853.728309965595, + 743.4129005375446, 620.8811261003843, 734.5169538210494, 746.3815770431946, + 767.290326480537, 831.426421077215, 967.7044336073391, 799.1068450615982, + 740.4996795184521, 916.2979036747394, 913.998045819944, 869.4250466596269, + 757.0654352089211, 632.2700994598315, 747.9746365493155, 760.0406470414546, + 781.3155927861407, 846.6062124357129, 985.3515890831374, 813.6623153898074, + 753.971773024426, 932.948704890676, 930.5874713322485, 885.1868269363512, + 770.8116541841815, 643.7682546871349, 761.5980848335092, 773.9053516159433, + 795.5904868301798, 862.097925051032, 1003.4100096401651, 828.5972143730538, + 767.8323627314965, 950.1258866635776, 947.7474943147857, 901.5346949184684, + 785.0616908563728, 655.6817269099574, 775.7064045578206, 788.2561978651455, + 810.3583961634973, 878.1165551620314, 1022.0732093740195, + 844.0245031958057, 782.1427236307421, 967.8515674303295, 965.4466106656407, + 918.3877297855815, 799.8538370939436, 668.1333454652005, 790.5524033879444, + 803.459332816087, 826.108063571198, 895.3134514924494, 1042.2410362478515, + 860.8043211232875, 797.8084140710902, 987.380577568884, 985.070478817885, + 937.1914846973294, 816.2674862348711, 681.8747624839331, 806.8480185521136, + 820.058014438139, 843.2127075315198, 913.8922516019386, 1063.9167795365272, + 878.7463461347362, 814.4741594106707, 1008.0518756015116, + 1005.7388118422177, 956.8984343144197, 833.4115778683818, + 696.1794021347649, 823.7545213012464, 837.2211158838319, 860.8396462744752, + 932.9742000022414, 1086.1050145867903, 897.0511641651588, + 831.4200884378382, 1029.0005500766997, 1026.614647624499, + 976.7369375395039, 850.6554733678313, 710.555072872696, 840.7304736170634, + 854.4399674883024, 878.5086566011242, 952.0852181787353, + 1108.3078532654486, 915.352156999312, 848.3477494984529, + 1049.9083963048731, 1047.4315753339215, 996.5021054213274, + 867.845769992844, 724.8945525649602, 857.67375876012, 871.6359409812918, + 896.1647589400909, 971.1937531105918, 1130.5211975845266, + 933.6728926575109, 865.3039663488835, 1070.8642808341096, + 1068.3090984149162, 1016.336979004283, 885.0952761261011, + 739.2822397784581, 874.6726050987934, 888.8868809150674, 913.8758344501284, + 990.3601961264797, 1152.8000105534302, 952.0460971111784, + 882.3073280719644, 1091.8766776280636, 1089.2411726200557, + 1036.222013932953, 902.4122112050944, 753.7460812795113, 891.7850191776419, + 906.2770829414828, 931.7546069841886, 1009.7349438943148, 1175.35222675699, + 970.6706392906041, 899.5672922254536, 1113.2359260434653, + 1110.548491237557, 1056.49183613467, 920.0733853344464, 768.5050853882003, + 909.2556839117292, 924.0405370917669, 950.0265624350877, 1029.546008599959, + 1198.424230306896, 989.7342827840929, 917.243304874731, 1135.1213209562181, + 1132.3919356630518, 1077.2823898714805, 938.191271349785, + 783.6482540999683, 927.1840543433264, 942.2723732885142, 968.7833969126399, + 1049.8861414791077, 1222.1162810562791, 1009.3134651367249, + 935.4003080919703, 1157.6059331904446, 1154.8371216610096, + 1098.6491728980113, 956.8100097094092, 799.2089556349343, + 945.6054681239282, 961.0042945365276, 988.0533773635766, 1070.781285650527, + 1246.4531185099297, 1029.4241093239923, 954.0488803624589, + 1180.6976832812468, 1177.886792447048, 1120.589887697527, + 975.9282944261879, 815.1866795170139, 964.5200079153366, 980.2370826047496, + 1007.8380248939005, 1092.2338668999907, 1271.4384711883802, + 1050.07004182296, 973.1932603691707, 1204.4026736638718, 1201.547890596531, + 1143.111952149096] +post_bill_rough = { + 'date_from': proforma_date_from, + 'date_to': proforma_date_to, + 'usage': post_proj_rough_usage, + 'charge': post_proj_rough_charge, + 'price': prior_proj_rough_price + } # global variables - # inflation coefficient dictionary. this is NOT inflation rate + + inflation_coeff_dict = { datetime.date(1981, 1, 31): 0.3381208260704529, datetime.date(1981, 2, 28): 0.3410451203881943, diff --git a/bpfin/utilbills/bill_post_proj_rough.py b/bpfin/utilbills/bill_post_proj_rough.py index 043d499..b9747ad 100644 --- a/bpfin/utilbills/bill_post_proj_rough.py +++ b/bpfin/utilbills/bill_post_proj_rough.py @@ -1,6 +1,7 @@ import datetime import bpfin.utilbills.bill_lib as bl import bpfin.lib.other as lib +from bpfin.tests.testdata import sample_data as db def bill_post_proj_rough(prior_bill, saving_percent): @@ -21,6 +22,24 @@ def bill_post_proj_rough(prior_bill, saving_percent): 'usage': post_monthly_usage, 'charge': post_monthly_charge, 'price': post_monthly_price} """ + post_bill_start = prior_bill['date_from'] + post_bill_end = prior_bill['date_to'] + post_monthly_price = prior_bill['price'] + post_monthly_usage = lib.multiply_list(prior_bill['usage'], saving_percent) + post_monthly_charge = lib.product2list(post_monthly_usage, post_monthly_price) + writein = str(post_monthly_charge) + f = open('data_generation.py', 'w') + f.write(writein) + f.close() + return { + 'date_from': post_bill_start, + 'date_to': post_bill_end, + 'usage': post_monthly_usage, + 'charge': post_monthly_charge, + 'price': post_monthly_price + } + +print(bill_post_proj_rough(db.prior_bill_rough, 0.25)) -- GitLab From b32fd28366d41d5f9fca29d0f16a305925673bb4 Mon Sep 17 00:00:00 2001 From: chenzheng06 Date: Tue, 25 Apr 2017 13:33:11 -0400 Subject: [PATCH 3/4] Clean bill_post_proj_rough Create test file and sample data for it --- .../test_bill_post_proj_rough.py | 10 + .../test_bill_prior_proj_rough.py | 9 +- bpfin/tests/testdata/sample_data.py | 405 +++++++++--------- bpfin/utilbills/bill_post_proj_rough.py | 6 +- 4 files changed, 222 insertions(+), 208 deletions(-) diff --git a/bpfin/tests/test_utilbills/test_bill_post_proj_rough.py b/bpfin/tests/test_utilbills/test_bill_post_proj_rough.py index e69de29..cc6abfd 100644 --- a/bpfin/tests/test_utilbills/test_bill_post_proj_rough.py +++ b/bpfin/tests/test_utilbills/test_bill_post_proj_rough.py @@ -0,0 +1,10 @@ +from bpfin.utilbills.bill_post_proj_rough import bill_post_proj_rough +from bpfin.tests.testdata import sample_data as db + + +def test_bill_post_proj_rough(): + input_prior_bill = db.prior_bill_rough + input_saving_percent = 0.25 + output_dict = db.post_bill_rough + result_dict = bill_post_proj_rough(input_prior_bill, input_saving_percent) + assert output_dict == result_dict diff --git a/bpfin/tests/test_utilbills/test_bill_prior_proj_rough.py b/bpfin/tests/test_utilbills/test_bill_prior_proj_rough.py index d031665..c39870f 100644 --- a/bpfin/tests/test_utilbills/test_bill_prior_proj_rough.py +++ b/bpfin/tests/test_utilbills/test_bill_prior_proj_rough.py @@ -7,14 +7,7 @@ def test_bill_prior_proj_rough(): raw_bill = db.raw_bill analysis_date = db.analysis_date inflation_coeff_dict = db.inflation_coeff_dict - - output_dict = { - 'date_from': db.proforma_date_from, - 'date_to': db.proforma_date_to, - 'usage': db.prior_proj_rough_usage, - 'charge': db.prior_proj_rough_charge, - 'price': db.prior_proj_rough_price - } + output_dict = db.prior_bill_rough result_dict = bill_prior_proj_rough(month_norm_bill, raw_bill, analysis_date, inflation_coeff_dict) diff --git a/bpfin/tests/testdata/sample_data.py b/bpfin/tests/testdata/sample_data.py index a30071a..864b648 100644 --- a/bpfin/tests/testdata/sample_data.py +++ b/bpfin/tests/testdata/sample_data.py @@ -204,20 +204,20 @@ income_next = {} income_next[1] = { 'year': 2017, 'revenue': 101000.0, 'utility_expense': 59652.416499097984, 'energy_opex': 37553.27291517199, 'electricity_opex': 34523.27291517199, 'gas_opex': 1520, 'oil_opex': 1510, 'water_opex': 0, - 'other_utility': 22099.143583925994, 'non_utility_expense': 3366.6666666666665, 'net_non_energy_opex': 25465.81025059266, - 'total_opex': 63019.08316576465, 'noi': 37980.91683423535} + 'other_utility': 22099.143583925994, 'non_utility_expense': 3366.6666666666665, + 'net_non_energy_opex': 25465.81025059266, 'total_opex': 63019.08316576465, 'noi': 37980.91683423535} # growth_rate_flag == 0.00 income_next[2] = { 'year': 2017, 'revenue': 100000.0, 'utility_expense': 59433.61309727693, 'energy_opex': 37553.27291517199, 'electricity_opex': 34523.27291517199, 'gas_opex': 1520, 'oil_opex': 1510, 'water_opex': 0, - 'other_utility': 21880.340182104945, 'non_utility_expense': 3333.3333333333335, 'net_non_energy_opex': 25213.673515438277, - 'total_opex': 62766.94643061027, 'noi': 37233.05356938973} + 'other_utility': 21880.340182104945, 'non_utility_expense': 3333.3333333333335, + 'net_non_energy_opex': 25213.673515438277, 'total_opex': 62766.94643061027, 'noi': 37233.05356938973} # growth_rate_flag == -1.0 income_next[3] = { 'year': 2017, 'revenue': 95000.0, 'utility_expense': 58339.59608817169, 'energy_opex': 37553.27291517199, 'electricity_opex': 34523.27291517199, 'gas_opex': 1520, 'oil_opex': 1510, 'water_opex': 0, - 'other_utility': 20786.3231729997, 'non_utility_expense': 3166.6666666666665, 'net_non_energy_opex':23952.989839666367, - 'total_opex': 61506.26275483836, 'noi': 33493.73724516164} + 'other_utility': 20786.3231729997, 'non_utility_expense': 3166.6666666666665, + 'net_non_energy_opex': 23952.989839666367, 'total_opex': 61506.26275483836, 'noi': 33493.73724516164} # growth_rate_flag == -2.0 income_next[4] = { 'year': 2017, 'revenue': 105409.25533894598, 'utility_expense': 60617.176566756985, 'energy_opex': 37553.27291517199, @@ -1021,202 +1021,217 @@ prior_bill_rough = { 'price': prior_proj_rough_price } +post_proj_rough_charge = [ + 1859.2014191475037, 1553.0884418312685, 1837.726739684238, + 1867.8044329345366, 1920.5322046853819, 2081.503153111865, + 2423.1894138931943, 2001.432112115146, 1855.0356838309879, + 2295.913209808375, 2290.6325172702263, 2179.3836188506457, + 1897.2053695429759, 1584.028396463902, 1873.3830301048613, + 1903.0750754821224, 1955.8024501137115, 2118.650583902494, + 2465.1792256764056, 2035.0771216276828, 1885.2595473042438, + 2332.1324915727246, 2325.5840844231802, 2211.511384940947, + 1925.4063379912554, 1607.768699530916, 1901.6900895999775, + 1932.0645738338133, 1985.8354380617452, 2151.4445757596272, + 2503.6399874839385, 2067.0777240752723, 1915.1360807258125, + 2369.377521170649, 2363.010468049987, 2247.373901404105, 1954.177336637983, + 1629.7484108216622, 1925.2722962252867, 1953.5722486772652, + 2005.42543146049, 2169.9455961918457, 2522.0052365450965, + 2079.6312412128063, 1924.3523125660456, 2377.7962247832843, + 2368.4348150513797, 2249.710035165335, 1958.4613993578723, + 1635.2021201081548, 1933.9394310833006, 1964.62658019011, + 2019.0956247028275, 2187.2531296731077, 2545.048227737386, + 2101.049076994495, 1946.4097950772614, 2407.820790014731, + 2401.103023695569, 2283.3670790902765, 1989.2284890755493, + 1662.116881118693, 1967.2223585859315, 1999.9128161271326, + 2056.877371212701, 2229.82625030877, 2596.500785182561, 2145.107707338978, + 1988.69257579388, 2461.943010270735, 2456.88650458826, 2338.139936775805, + 2037.2302309654235, 1702.462988420119, 2015.256114353034, + 2049.031034489731, 2107.689102309963, 2285.229651712486, 2661.386576158895, + 2199.0205304604283, 2038.9590808754679, 2524.5241540969605, + 2519.6911264451633, 2398.244122007635, 2089.2338079131673, + 1745.6157670945538, 2065.9759824428297, 2100.233595622051, + 2159.9796478556013, 2341.515320261667, 2726.4601798473045, + 2252.394847846601, 2088.0831819676946, 2584.8947211544837, + 2579.494937951015, 2454.7360811800563, 2138.402572437745, + 1786.660701465149, 2114.5098043224843, 2149.5276787591197, + 2210.630233759071, 2396.37320955687, 2790.2789128143045, + 2305.0693117408364, 2136.8708012684115, 2645.235452991637, + 2639.654951638436, 2511.934396174742, 2187.570465709978, 1827.190231123913, + 2161.82472392719, 2196.9638683359894, 2258.733924218244, 2447.780786364695, + 2849.2777014601907, 2353.099262273337, 2180.7386468237887, + 2698.725959566911, 2692.2210105236272, 2561.184929896785, + 2230.2387016126336, 1862.6433783011532, 2203.550861463148, + 2239.1447311295838, 2301.870979441611, 2494.2792632316446, + 2903.1133008220177, 2397.3205351847946, 2221.4990385553565, + 2748.893711024218, 2741.9941374598316, 2608.2751399788804, + 2271.196305626763, 1896.8102983794947, 2243.9239096479464, + 2280.1219411243637, 2343.946778358422, 2539.8186373071385, + 2956.054767249412, 2440.9869461694225, 2261.915319073278, + 2798.846114672028, 2791.762413996745, 2655.5604808090534, + 2312.434962552544, 1931.3047640614047, 2284.7942545005276, + 2321.71605484783, 2386.771460490539, 2586.293775153096, 3010.2300289204954, + 2485.7916431191616, 2303.497088194489, 2850.377659990733, + 2843.242482944357, 2704.604084755405, 2355.1850725691183, + 1967.0451807298723, 2327.1192136734617, 2364.7685935954364, + 2431.0751884904917, 2634.349665486094, 3066.2196281220586, + 2532.073509587417, 2346.4281708922263, 2903.554702290988, + 2896.339831996922, 2755.1631893567446, 2399.561511281831, + 2004.4000363956013, 2371.657210163833, 2410.3779984482608, + 2478.324190713594, 2685.940354477348, 3126.7231087435553, + 2582.4129633698626, 2393.4252422132704, 2962.1417327066515, + 2955.211436453655, 2811.574454091988, 2448.802458704613, + 2045.6242874517993, 2420.544055656341, 2460.174043314417, + 2529.6381225945593, 2741.676754805816, 3191.750338609582, + 2636.2390384042087, 2443.422478232012, 3024.1556268045347, + 3017.2164355266527, 2870.695302943259, 2500.2347336051453, + 2088.538206404295, 2471.2635639037394, 2511.6633476514958, + 2582.5189388234253, 2798.922600006724, 3258.3150437603713, + 2691.1534924954767, 2494.2602653135145, 3087.001650230099, + 3079.843942873497, 2930.2108126185117, 2551.966420103494, + 2131.665218618088, 2522.19142085119, 2563.319902464907, 2635.5259698033724, + 2856.2556545362063, 3324.923559796346, 2746.0564709979362, + 2545.0432484953585, 3149.725188914619, 3142.2947260017645, + 2989.506316263982, 2603.537309978532, 2174.683657694881, 2573.02127628036, + 2614.9078229438755, 2688.4942768202723, 2913.5812593317755, + 3391.5635927535805, 2801.0186779725327, 2595.9118990466504, + 3212.592842502329, 3204.9272952447486, 3049.010937012849, + 2655.2858283783034, 2217.8467193353745, 2624.01781529638, + 2666.6606427452025, 2741.6275033503853, 2971.0805883794387, + 3458.4000316602906, 2856.1382913335356, 2646.9219842158936, + 3275.6300328841903, 3267.723517860167, 3108.6660417988583, + 2707.236633615283, 2261.238243838534, 2675.3550575329255, + 2718.8312488244483, 2795.2638209525658, 3029.2048316829446, + 3526.05668027097, 2912.0119178718123, 2698.701876676361, + 3339.7077781303956, 3331.645473712671, 3169.4755084040094, + 2760.220156003339, 2305.5152561646014, 2727.767051735187, + 2772.121611275301, 2850.079687305263, 3088.6380257998767, + 3595.2726909206885, 2969.202848352279, 2751.729914624193, + 3405.3639628686547, 3397.175806989155, 3231.8471696144416, + 2814.573814049355, 2350.944762299905, 2781.5521630299786, + 2826.8171198655427, 2906.3501907379195, 3149.658424437323, + 3666.3488431688374, 3027.9403954101745, 2806.200924275911, + 3472.8177995713336, 3464.5113649830287, 3295.947518694034, + 2870.4300291282275, 2397.626866904803, 2836.8164043717843, + 2883.012883609583, 2964.16013209073, 3212.343856951581, 3739.3593555297894, + 3088.272327971977, 2862.146641087377, 3542.09304984374, 3533.660377341144, + 3361.769663092581, 2927.7848832785635, 2445.560038551042, + 2893.5600237460094, 2940.711247814249, 3023.5140746817015, + 3276.701600699972, 3814.3154135651407, 3150.2101254688805, + 2919.579781107512, 3613.2080209916153, 3604.6436717895926, 3429.335856447288] + post_proj_rough_usage = [ - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417, - 0.02316413616153906, 0.020351769343799942, 0.02406496149982961, - 0.02397617462654837, 0.024926452028929815, 0.026783994476967665, - 0.030905756417035447, 0.026042477191985342, 0.022508299020931655, - 0.02486516252818199, 0.02326718923407694, 0.023677584957960417] + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125, + 0.06949240848461717, 0.06105530803139983, 0.07219488449948883, + 0.07192852387964511, 0.07477935608678944, 0.080351983430903, + 0.09271726925110635, 0.07812743157595603, 0.06752489706279496, + 0.07459548758454597, 0.06980156770223081, 0.07103275487388125] -post_proj_rough_charge = [ - 619.7338063825013, 517.6961472770894, 612.575579894746, 622.6014776448455, - 640.177401561794, 693.8343843706216, 807.7298046310648, 667.1440373717153, - 618.3452279436626, 765.3044032694584, 763.5441724234088, 726.4612062835487, - 632.4017898476586, 528.0094654879673, 624.4610100349538, 634.3583584940408, - 651.9341500379039, 706.2168613008313, 821.7264085588018, 678.3590405425609, - 628.4198491014146, 777.3774971909082, 775.1946948077268, 737.1704616469825, - 641.8021126637518, 535.9228998436387, 633.8966965333259, 644.021524611271, - 661.9451460205818, 717.1481919198758, 834.5466624946462, 689.0259080250906, - 638.3786935752709, 789.792507056883, 787.6701560166625, 749.1246338013683, - 651.3924455459943, 543.2494702738874, 641.7574320750956, 651.1907495590884, - 668.4751438201633, 723.3151987306153, 840.6684121816988, 693.210413737602, - 641.4507708553485, 792.598741594428, 789.4782716837934, 749.9033450551117, - 652.8204664526241, 545.0673733693849, 644.6464770277669, 654.8755267300367, - 673.0318749009425, 729.0843765577026, 848.3494092457953, 700.3496923314983, - 648.8032650257538, 802.6069300049104, 800.3676745651898, 761.1223596967588, - 663.0761630251832, 554.0389603728976, 655.7407861953105, 666.6376053757109, - 685.6257904042336, 743.2754167695899, 865.5002617275202, 715.0359024463258, - 662.8975252646267, 820.6476700902451, 818.9621681960866, 779.3799789252683, - 679.0767436551412, 567.4876628067063, 671.752038117678, 683.0103448299104, - 702.563034103321, 761.7432172374953, 887.1288587196315, 733.0068434868094, - 679.6530269584892, 841.5080513656536, 839.8970421483878, 799.4147073358783, - 696.4112693043891, 581.8719223648512, 688.6586608142767, 700.0778652073503, - 719.9932159518671, 780.505106753889, 908.8200599491014, 750.7982826155337, - 696.0277273225649, 861.6315737181612, 859.8316459836717, 818.2453603933521, - 712.8008574792484, 595.5535671550497, 704.8366014408282, 716.50922625304, - 736.8767445863571, 798.7910698522899, 930.0929709381013, 768.3564372469455, - 712.2902670894705, 881.7451509972124, 879.8849838794788, 837.3114653915807, - 729.1901552366594, 609.0634103746377, 720.6082413090635, 732.3212894453297, - 752.9113080727479, 815.9269287882317, 949.7592338200635, 784.3664207577789, - 726.9128822745962, 899.5753198556371, 897.4070035078757, 853.728309965595, - 743.4129005375446, 620.8811261003843, 734.5169538210494, 746.3815770431946, - 767.290326480537, 831.426421077215, 967.7044336073391, 799.1068450615982, - 740.4996795184521, 916.2979036747394, 913.998045819944, 869.4250466596269, - 757.0654352089211, 632.2700994598315, 747.9746365493155, 760.0406470414546, - 781.3155927861407, 846.6062124357129, 985.3515890831374, 813.6623153898074, - 753.971773024426, 932.948704890676, 930.5874713322485, 885.1868269363512, - 770.8116541841815, 643.7682546871349, 761.5980848335092, 773.9053516159433, - 795.5904868301798, 862.097925051032, 1003.4100096401651, 828.5972143730538, - 767.8323627314965, 950.1258866635776, 947.7474943147857, 901.5346949184684, - 785.0616908563728, 655.6817269099574, 775.7064045578206, 788.2561978651455, - 810.3583961634973, 878.1165551620314, 1022.0732093740195, - 844.0245031958057, 782.1427236307421, 967.8515674303295, 965.4466106656407, - 918.3877297855815, 799.8538370939436, 668.1333454652005, 790.5524033879444, - 803.459332816087, 826.108063571198, 895.3134514924494, 1042.2410362478515, - 860.8043211232875, 797.8084140710902, 987.380577568884, 985.070478817885, - 937.1914846973294, 816.2674862348711, 681.8747624839331, 806.8480185521136, - 820.058014438139, 843.2127075315198, 913.8922516019386, 1063.9167795365272, - 878.7463461347362, 814.4741594106707, 1008.0518756015116, - 1005.7388118422177, 956.8984343144197, 833.4115778683818, - 696.1794021347649, 823.7545213012464, 837.2211158838319, 860.8396462744752, - 932.9742000022414, 1086.1050145867903, 897.0511641651588, - 831.4200884378382, 1029.0005500766997, 1026.614647624499, - 976.7369375395039, 850.6554733678313, 710.555072872696, 840.7304736170634, - 854.4399674883024, 878.5086566011242, 952.0852181787353, - 1108.3078532654486, 915.352156999312, 848.3477494984529, - 1049.9083963048731, 1047.4315753339215, 996.5021054213274, - 867.845769992844, 724.8945525649602, 857.67375876012, 871.6359409812918, - 896.1647589400909, 971.1937531105918, 1130.5211975845266, - 933.6728926575109, 865.3039663488835, 1070.8642808341096, - 1068.3090984149162, 1016.336979004283, 885.0952761261011, - 739.2822397784581, 874.6726050987934, 888.8868809150674, 913.8758344501284, - 990.3601961264797, 1152.8000105534302, 952.0460971111784, - 882.3073280719644, 1091.8766776280636, 1089.2411726200557, - 1036.222013932953, 902.4122112050944, 753.7460812795113, 891.7850191776419, - 906.2770829414828, 931.7546069841886, 1009.7349438943148, 1175.35222675699, - 970.6706392906041, 899.5672922254536, 1113.2359260434653, - 1110.548491237557, 1056.49183613467, 920.0733853344464, 768.5050853882003, - 909.2556839117292, 924.0405370917669, 950.0265624350877, 1029.546008599959, - 1198.424230306896, 989.7342827840929, 917.243304874731, 1135.1213209562181, - 1132.3919356630518, 1077.2823898714805, 938.191271349785, - 783.6482540999683, 927.1840543433264, 942.2723732885142, 968.7833969126399, - 1049.8861414791077, 1222.1162810562791, 1009.3134651367249, - 935.4003080919703, 1157.6059331904446, 1154.8371216610096, - 1098.6491728980113, 956.8100097094092, 799.2089556349343, - 945.6054681239282, 961.0042945365276, 988.0533773635766, 1070.781285650527, - 1246.4531185099297, 1029.4241093239923, 954.0488803624589, - 1180.6976832812468, 1177.886792447048, 1120.589887697527, - 975.9282944261879, 815.1866795170139, 964.5200079153366, 980.2370826047496, - 1007.8380248939005, 1092.2338668999907, 1271.4384711883802, - 1050.07004182296, 973.1932603691707, 1204.4026736638718, 1201.547890596531, - 1143.111952149096] post_bill_rough = { - 'date_from': proforma_date_from, - 'date_to': proforma_date_to, - 'usage': post_proj_rough_usage, - 'charge': post_proj_rough_charge, - 'price': prior_proj_rough_price - } + 'date_from': proforma_date_from, + 'date_to': proforma_date_to, + 'usage': post_proj_rough_usage, + 'charge': post_proj_rough_charge, + 'price': prior_proj_rough_price} + # global variables - # inflation coefficient dictionary. this is NOT inflation rate - inflation_coeff_dict = { datetime.date(1981, 1, 31): 0.3381208260704529, datetime.date(1981, 2, 28): 0.3410451203881943, diff --git a/bpfin/utilbills/bill_post_proj_rough.py b/bpfin/utilbills/bill_post_proj_rough.py index b9747ad..024cda3 100644 --- a/bpfin/utilbills/bill_post_proj_rough.py +++ b/bpfin/utilbills/bill_post_proj_rough.py @@ -25,13 +25,9 @@ def bill_post_proj_rough(prior_bill, saving_percent): post_bill_start = prior_bill['date_from'] post_bill_end = prior_bill['date_to'] post_monthly_price = prior_bill['price'] - post_monthly_usage = lib.multiply_list(prior_bill['usage'], saving_percent) + post_monthly_usage = lib.multiply_list(prior_bill['usage'], (1-saving_percent)) post_monthly_charge = lib.product2list(post_monthly_usage, post_monthly_price) - writein = str(post_monthly_charge) - f = open('data_generation.py', 'w') - f.write(writein) - f.close() return { 'date_from': post_bill_start, -- GitLab From dd056f98934284ccc72e5291f0f118875ae432f9 Mon Sep 17 00:00:00 2001 From: chenzheng06 Date: Tue, 25 Apr 2017 15:02:42 -0400 Subject: [PATCH 4/4] Delete unused import. Clean code --- bpfin/lib/other.py | 8 -------- bpfin/utilbills/bill_post_proj_rough.py | 9 +-------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/bpfin/lib/other.py b/bpfin/lib/other.py index d7754f8..e7edb31 100644 --- a/bpfin/lib/other.py +++ b/bpfin/lib/other.py @@ -1,14 +1,6 @@ -import bpfin.lib.date -import bpfin.lib.math - -import statsmodels.api as sm import datetime import calendar -# from dateutil.parser import * -import dateutil.parser import numpy as np -import pandas as pd -import xlrd from scipy.optimize import linprog import matplotlib matplotlib.use('TkAgg') diff --git a/bpfin/utilbills/bill_post_proj_rough.py b/bpfin/utilbills/bill_post_proj_rough.py index 024cda3..5a975f4 100644 --- a/bpfin/utilbills/bill_post_proj_rough.py +++ b/bpfin/utilbills/bill_post_proj_rough.py @@ -1,7 +1,5 @@ import datetime -import bpfin.utilbills.bill_lib as bl import bpfin.lib.other as lib -from bpfin.tests.testdata import sample_data as db def bill_post_proj_rough(prior_bill, saving_percent): @@ -28,14 +26,9 @@ def bill_post_proj_rough(prior_bill, saving_percent): post_monthly_usage = lib.multiply_list(prior_bill['usage'], (1-saving_percent)) post_monthly_charge = lib.product2list(post_monthly_usage, post_monthly_price) - return { 'date_from': post_bill_start, 'date_to': post_bill_end, 'usage': post_monthly_usage, 'charge': post_monthly_charge, - 'price': post_monthly_price - } - - -print(bill_post_proj_rough(db.prior_bill_rough, 0.25)) + 'price': post_monthly_price} -- GitLab