Skip to content

Commit

Permalink
refactor: simplify data pre-processing in calculate_state_slopes (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielolsen committed Jan 5, 2022
1 parent f0fc597 commit abb67b3
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 184 deletions.
3 changes: 1 addition & 2 deletions prereise/gather/demanddata/bldg_electrification/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@
)

# Reference temperatures for computations
temp_ref_res = 18.3
temp_ref_com = 16.7
temp_ref = {"res": 18.3, "com": 16.7}

# Unit conversions
conv_kw_to_mw = 1 / 1000
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
month,US,AL,AK,AZ,AR,CA,CO,CT,DE,DC,FL,GA,HI,ID,IL,IN,IA,KS,KY,LA,ME,MD,MA,MI,MN,MS,MO,MT,NE,NV,NH,NJ,NM,NY,NC,ND,OH,OK,OR,PA,RI,SC,SD,TN,TX,UT,VT,VA,WA,WV,WI,WY
10-Jan,517573959,4435249,2278289,4234071,6609838,28436614,10013272,6995602,1795047,2913970,5731499,11576031,170068,2375767,36369664,15564333,10238301,6971751,7422846,3731126,910486,11410111,12888873,27234731,17852992,3519578,12174380,3299734,5824829,4150074,1547204,29702791,4445619,42754473,10059937,1879044,28738381,8662061,4162518,24712747,1970300,3657499,2138294,10178155,28244769,6874273,403393,11757506,6969677,3874232,15852619,1857267
10-Feb,457170783,3998672,1699643,3766384,6123485,27228509,9059232,6147336,1708976,2827899,5652687,10059937,148291,1791936,29370951,13398040,8262816,5593578,6918864,3624315,764269,9923053,11999127,24445201,14238010,3457358,10479922,2801974,5007673,3376472,1270325,23573084,4234071,39203785,9240707,1620831,28848303,8038824,3073668,23052510,1662311,3483283,1673718,9540400,25099548,5031524,369172,10994274,5747054,3661647,12393187,1491206
10-Mar,349658771,3511282,1857267,3485357,5327069,21843368,7022564,4685166,1165588,1910154,5528247,6983158,151402,1638460,24190099,7825202,5964824,4305624,4199850,3047743,628422,7308776,8109340,18426453,9855648,2869379,7731872,2148664,4583540,3165961,993446,18108094,3431433,30841417,5343661,1186328,18596521,6681391,2839306,17081464,1253733,2371619,1303509,7520324,22687486,4515098,268583,7095154,5005599,2861083,8887090,1318027
10-Apr,223343875,2101999,1369877,2855898,3161813,21965734,4825161,2687904,750788,1160403,5076115,3092334,170068,1267214,12320597,3417952,2962709,2036668,1654015,2135183,466650,4173925,5310477,13331672,5632984,1424838,3812012,1582462,2571760,2762568,618052,12464740,2642276,20462084,2790567,583831,10147045,3921934,2565538,9153599,690642,1509872,684420,3684461,14701549,3878380,197030,4189480,4593910,1655052,5085448,1043222
10-May,167116698,1282769,851377,2412062,2166293,19811885,3292475,2340509,630496,909449,4094076,2517836,145180,934337,8757465,2903600,2176663,1131367,1251659,1684088,322507,3326696,3639870,7348182,4418657,1070184,2477393,1265140,1481873,2206736,401319,10109713,1580388,17429896,2477393,482205,5908826,1993114,1983781,5986601,451095,1310768,556869,2328065,11778246,2571760,125477,2981375,3675128,1571055,3768458,793305
10-Jun,134511344,1144848,659532,2066741,2026298,16655257,1693421,1744234,561017,795379,3738385,2204662,155550,661606,6813090,2187033,1969263,988261,1039074,1553426,236436,2692052,2446283,5397585,2913970,1026630,1828231,792268,1185291,1928820,305915,8339554,1153144,13361745,2050149,283101,4766052,1582462,1530612,4618798,284138,1180106,340136,2116517,11386260,1863489,89182,2759457,2967894,983076,2940932,505019
10-Jul,124629771,1043222,637755,1873859,1931931,15544630,1623942,1786751,619089,781898,3621204,2188070,161772,502945,6425252,2118591,1837564,1014186,1045296,1451800,222955,2055334,2110295,4740127,2441098,974780,1744234,668865,1124108,1672681,251991,7980752,836859,13783804,1997262,254065,4222664,1476688,1108553,4146963,227103,1239215,320433,1947486,10619917,1179069,70516,2859009,2246142,1083665,2477393,337025
10-Aug,131359901,1076406,710345,1733864,2034594,15407746,1830305,2019039,664717,787083,3607723,2181848,155550,473909,6686576,2107184,1760826,991372,1103368,1486021,226066,3202256,2919155,4651982,2695163,985150,1859341,660569,861747,1643645,275842,10723617,807823,15120497,2169404,297619,4552430,1364692,996557,4529616,301767,1256844,293471,1788825,10525550,1049444,73627,2581093,2202588,1152107,2473245,300730
10-Sep,137862928,1019371,858636,1831342,2157997,19230128,1781566,1853119,590053,801601,3542392,2171478,139995,642940,7722539,2736643,1965115,843081,1247511,1563796,231251,2890119,2363323,5232702,2580056,974780,1972374,687531,912560,1685125,279990,9908535,820267,13435372,2523021,370209,5199518,1430023,985150,4683092,402356,1292102,376431,2034594,11072049,1151070,81923,3010411,2119628,1110627,2997967,345321
10-Oct,192194469,1222623,1291065,2057408,2585241,21329016,3272772,2314584,843081,1220549,4033930,2941969,146217,936411,11286708,4640575,2928488,1111664,1752530,1683051,430355,4582503,3736311,8393478,4961008,1215364,3095445,1241289,1391654,1963041,551684,13105606,1035963,19797367,3232329,563091,8373775,1525427,1804380,8639247,566202,1533723,586942,2906711,11901649,2065704,166957,4168740,4082669,1528538,4786792,659532
10-Nov,297303752,2534428,1798158,3061224,2955450,23223615,7160485,3673054,1208105,1855193,4695536,5190185,144143,1893562,21329016,7346108,5236850,2933673,3242699,2267919,657458,6287331,6814127,13926910,9683506,1554463,5840384,2757383,3545503,2611166,853451,15188939,1817861,27710714,5382030,1283806,14930726,2113406,3287290,14314748,1067073,2178737,1294176,4635390,15691884,4442508,250954,6661688,6344366,2352953,8734651,1337730
10-Dec,484663727,4702795,2497096,3749792,4639538,26495350,8216151,5914011,2108221,3269661,6744648,11270116,154513,2472208,34090338,14445410,8280445,5053301,7302554,3780902,948855,12203416,12381780,24855853,16017502,2889082,10442590,3311141,4685166,3399286,1366766,28990372,3278994,44121239,11038865,1879044,27909818,4578355,3916749,26022478,1969263,3998672,1864526,9591213,22073582,5261738,375394,12404594,7279740,3995561,14847766,1578314
1,517573959,4435249,2278289,4234071,6609838,28436614,10013272,6995602,1795047,2913970,5731499,11576031,170068,2375767,36369664,15564333,10238301,6971751,7422846,3731126,910486,11410111,12888873,27234731,17852992,3519578,12174380,3299734,5824829,4150074,1547204,29702791,4445619,42754473,10059937,1879044,28738381,8662061,4162518,24712747,1970300,3657499,2138294,10178155,28244769,6874273,403393,11757506,6969677,3874232,15852619,1857267
2,457170783,3998672,1699643,3766384,6123485,27228509,9059232,6147336,1708976,2827899,5652687,10059937,148291,1791936,29370951,13398040,8262816,5593578,6918864,3624315,764269,9923053,11999127,24445201,14238010,3457358,10479922,2801974,5007673,3376472,1270325,23573084,4234071,39203785,9240707,1620831,28848303,8038824,3073668,23052510,1662311,3483283,1673718,9540400,25099548,5031524,369172,10994274,5747054,3661647,12393187,1491206
3,349658771,3511282,1857267,3485357,5327069,21843368,7022564,4685166,1165588,1910154,5528247,6983158,151402,1638460,24190099,7825202,5964824,4305624,4199850,3047743,628422,7308776,8109340,18426453,9855648,2869379,7731872,2148664,4583540,3165961,993446,18108094,3431433,30841417,5343661,1186328,18596521,6681391,2839306,17081464,1253733,2371619,1303509,7520324,22687486,4515098,268583,7095154,5005599,2861083,8887090,1318027
4,223343875,2101999,1369877,2855898,3161813,21965734,4825161,2687904,750788,1160403,5076115,3092334,170068,1267214,12320597,3417952,2962709,2036668,1654015,2135183,466650,4173925,5310477,13331672,5632984,1424838,3812012,1582462,2571760,2762568,618052,12464740,2642276,20462084,2790567,583831,10147045,3921934,2565538,9153599,690642,1509872,684420,3684461,14701549,3878380,197030,4189480,4593910,1655052,5085448,1043222
5,167116698,1282769,851377,2412062,2166293,19811885,3292475,2340509,630496,909449,4094076,2517836,145180,934337,8757465,2903600,2176663,1131367,1251659,1684088,322507,3326696,3639870,7348182,4418657,1070184,2477393,1265140,1481873,2206736,401319,10109713,1580388,17429896,2477393,482205,5908826,1993114,1983781,5986601,451095,1310768,556869,2328065,11778246,2571760,125477,2981375,3675128,1571055,3768458,793305
6,134511344,1144848,659532,2066741,2026298,16655257,1693421,1744234,561017,795379,3738385,2204662,155550,661606,6813090,2187033,1969263,988261,1039074,1553426,236436,2692052,2446283,5397585,2913970,1026630,1828231,792268,1185291,1928820,305915,8339554,1153144,13361745,2050149,283101,4766052,1582462,1530612,4618798,284138,1180106,340136,2116517,11386260,1863489,89182,2759457,2967894,983076,2940932,505019
7,124629771,1043222,637755,1873859,1931931,15544630,1623942,1786751,619089,781898,3621204,2188070,161772,502945,6425252,2118591,1837564,1014186,1045296,1451800,222955,2055334,2110295,4740127,2441098,974780,1744234,668865,1124108,1672681,251991,7980752,836859,13783804,1997262,254065,4222664,1476688,1108553,4146963,227103,1239215,320433,1947486,10619917,1179069,70516,2859009,2246142,1083665,2477393,337025
8,131359901,1076406,710345,1733864,2034594,15407746,1830305,2019039,664717,787083,3607723,2181848,155550,473909,6686576,2107184,1760826,991372,1103368,1486021,226066,3202256,2919155,4651982,2695163,985150,1859341,660569,861747,1643645,275842,10723617,807823,15120497,2169404,297619,4552430,1364692,996557,4529616,301767,1256844,293471,1788825,10525550,1049444,73627,2581093,2202588,1152107,2473245,300730
9,137862928,1019371,858636,1831342,2157997,19230128,1781566,1853119,590053,801601,3542392,2171478,139995,642940,7722539,2736643,1965115,843081,1247511,1563796,231251,2890119,2363323,5232702,2580056,974780,1972374,687531,912560,1685125,279990,9908535,820267,13435372,2523021,370209,5199518,1430023,985150,4683092,402356,1292102,376431,2034594,11072049,1151070,81923,3010411,2119628,1110627,2997967,345321
10,192194469,1222623,1291065,2057408,2585241,21329016,3272772,2314584,843081,1220549,4033930,2941969,146217,936411,11286708,4640575,2928488,1111664,1752530,1683051,430355,4582503,3736311,8393478,4961008,1215364,3095445,1241289,1391654,1963041,551684,13105606,1035963,19797367,3232329,563091,8373775,1525427,1804380,8639247,566202,1533723,586942,2906711,11901649,2065704,166957,4168740,4082669,1528538,4786792,659532
11,297303752,2534428,1798158,3061224,2955450,23223615,7160485,3673054,1208105,1855193,4695536,5190185,144143,1893562,21329016,7346108,5236850,2933673,3242699,2267919,657458,6287331,6814127,13926910,9683506,1554463,5840384,2757383,3545503,2611166,853451,15188939,1817861,27710714,5382030,1283806,14930726,2113406,3287290,14314748,1067073,2178737,1294176,4635390,15691884,4442508,250954,6661688,6344366,2352953,8734651,1337730
12,484663727,4702795,2497096,3749792,4639538,26495350,8216151,5914011,2108221,3269661,6744648,11270116,154513,2472208,34090338,14445410,8280445,5053301,7302554,3780902,948855,12203416,12381780,24855853,16017502,2889082,10442590,3311141,4685166,3399286,1366766,28990372,3278994,44121239,11038865,1879044,27909818,4578355,3916749,26022478,1969263,3998672,1864526,9591213,22073582,5261738,375394,12404594,7279740,3995561,14847766,1578314
Loading

0 comments on commit abb67b3

Please sign in to comment.