Skip to content

Commit

Permalink
Merge pull request #78 from NREL/geometry_garage
Browse files Browse the repository at this point in the history
Altering geometry garage tsv for national, dsgrid, comed projects.
  • Loading branch information
ejhw committed Sep 6, 2017
2 parents 3edcfc5 + 131f856 commit f4b1e58
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 42 deletions.
14 changes: 10 additions & 4 deletions data/recs/RECS STUFF/query_recs_raw_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,12 @@ def calc_general(df, cut_by, columns=None, outfile=None,norm=True,outpath="Proba
else:
rename_dict[col] = 'Option=' + str(col)
g = g.rename(columns=rename_dict)

#Reduce garage size for small houses
if outfile == 'Geometry Garage.tsv':
g.loc[g['Dependency=Geometry House Size']=='0-1499', 'Option=2 Car'] = g.loc[g['Dependency=Geometry House Size']=='0-1499', 'Option=2 Car'] + g.loc[g['Dependency=Geometry House Size']=='0-1499', 'Option=3 Car']
g.loc[g['Dependency=Geometry House Size']=='0-1499', 'Option=3 Car'] = 0

#Generate Outfile
if not outfile is None:
g.to_csv(os.path.join(outpath, outfile), sep='\t', index=False)
Expand Down Expand Up @@ -909,14 +915,14 @@ def query(df):
# calc_general(df, cut_by=['yearmaderange','Size'], columns = ['Foundation Type'], outfile = 'FoundationType_output_by_vintage_size.tsv')
# calc_general(df, cut_by=['CR','FPL_BINS','Size'], columns = ['sizeofgarage'], outfile = 'SizeofGarage_output_by_CR_FPL_Size.tsv')
# calc_general(df, cut_by=['yearmaderange','Size','Foundation Type'], columns = ['stories'], outfile = 'Stories_output_by_vin_size_fndtype.tsv')
# calc_general(df, cut_by=['yearmaderange','Size'], columns = ['stories'], outfile = 'Geometry Stories.tsv', outpath='../../../resources/inputs/national')
# calc_general(df, cut_by=['yearmaderange','Size'], columns = ['sizeofgarage'], outfile = 'Geometry Garage.tsv', outpath='../../../resources/inputs/national')
# calc_general(df, cut_by=['CR'], columns = ['division'], outfile = 'Location Census Division.tsv', outpath='../../../resources/inputs/national')
# calc_general(df, cut_by=['yearmaderange','Size'], columns = ['stories'], outfile = 'Geometry Stories.tsv', outpath='../../../project_resstock_national/housing_characteristics')
# calc_general(df, cut_by=['yearmaderange','Size'], columns = ['sizeofgarage'], outfile = 'Geometry Garage.tsv', outpath='../../../project_resstock_national/housing_characteristics')
# calc_general(df, cut_by=['CR'], columns = ['division'], outfile = 'Location Census Division.tsv', outpath='../../../project_resstock_national/housing_characteristicsl')
# calc_general(df, cut_by=['CR','yearmaderange','Size','stories'], columns = [], outfile = 'Infiltration.tsv', outpath='../../../project_resstock_national/housing_characteristics')
pass
if __name__ == '__main__':
#Choose regerate if you want to redo the processed pkl file, otherwise comment out
df = erin_boyd()
# df = erin_boyd()

df = regenerate()
df = pd.read_pickle('processed_eia.recs_2009_microdata.pkl')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
Dependency=Vintage Dependency=Geometry House Size Option=1 Car Option=2 Car Option=3 Car Option=None Count Weight
<1950 0-1499 0.1164626505 0.0298583839718 0.00244059918353 0.851238366345 593 5642881.19652
<1950 0-1499 0.1164626505 0.0322989831553 0.0 0.851238366345 593 5642881.19652
<1950 1500-2499 0.0757267292439 0.0962732592865 0.00488221505446 0.823117796415 450 4207616.55967
<1950 2500-3499 0.0865429067103 0.0910146670389 0.00586818917745 0.816574237073 193 1767455.92658
<1950 3500+ 0.138099566588 0.268283114023 0.0374321657038 0.556185153685 109 1013195.5589
1950s 0-1499 0.180179692973 0.130017143854 0.00462466829017 0.685178494883 520 4704980.71899
1950s 0-1499 0.180179692973 0.134641812144 0.0 0.685178494883 520 4704980.71899
1950s 1500-2499 0.230158290699 0.182913642499 0.00665871194548 0.580269354856 434 4078571.52665
1950s 2500-3499 0.222037994648 0.254086688543 0.0246509800383 0.49922433677 109 1046418.08394
1950s 3500+ 0.185978776614 0.44741322796 0.100933562203 0.265674433223 57 510967.971536
1960s 0-1499 0.20669281662 0.202071204758 0.00514634031405 0.586089638308 399 3677143.824
1960s 0-1499 0.20669281662 0.207217545072 0.0 0.586089638308 399 3677143.824
1960s 1500-2499 0.199143697427 0.357972541972 0.00391671926536 0.438967041336 353 3212853.73228
1960s 2500-3499 0.178482912826 0.502641566221 0.0170928373836 0.30178268357 119 1104859.16371
1960s 3500+ 0.0665206287453 0.661949539888 0.105823147622 0.165706683745 76 696651.587576
1970s 0-1499 0.158246029053 0.294197363051 0.00618905966727 0.541367548229 389 3453731.72908
1970s 0-1499 0.158246029053 0.300386422718 0.0 0.541367548229 389 3453731.72908
1970s 1500-2499 0.109832447933 0.502165494294 0.028268843838 0.359733213934 463 4007564.16903
1970s 2500-3499 0.0858198904404 0.653938899417 0.0363595268405 0.223881683302 188 1583212.84808
1970s 3500+ 0.0453163656317 0.663740177145 0.135690496294 0.15525296093 96 745789.220492
1980s 0-1499 0.132012751865 0.318533374124 0.0182267527079 0.531227121303 298 2859601.63218
1980s 0-1499 0.132012751865 0.336760126832 0.0 0.531227121303 298 2859601.63218
1980s 1500-2499 0.122063575957 0.567117480017 0.0257407657572 0.285078178269 416 3870139.65139
1980s 2500-3499 0.118214761459 0.661861719114 0.0820224660959 0.137901053331 182 1620047.60238
1980s 3500+ 0.0395432779553 0.672500139507 0.181011858396 0.106944724142 101 869421.62693
1990s 0-1499 0.0959243798256 0.305975061975 0.0072245784902 0.590875979709 246 2447476.30038
1990s 0-1499 0.0959243798256 0.313199640465 0.0 0.590875979709 246 2447476.30038
1990s 1500-2499 0.0491361593196 0.618715259278 0.0938821540725 0.23826642733 408 3900135.87119
1990s 2500-3499 0.049507105264 0.668065136442 0.150516059417 0.131911698877 236 2137182.2478
1990s 3500+ 0.0164542758168 0.60499967315 0.328130924039 0.0504151269945 212 1872290.29433
2000s 0-1499 0.0675339879945 0.511259041143 0.01872480476 0.402482166102 226 2268849.8469
2000s 0-1499 0.0675339879945 0.529983845903 0.0 0.402482166102 226 2268849.8469
2000s 1500-2499 0.0500198778183 0.670162901301 0.0899094034384 0.189907817442 423 3910028.52417
2000s 2500-3499 0.035942257118 0.657652113179 0.207084497227 0.0993211324763 243 2229392.98066
2000s 3500+ 0.0216221220102 0.495822377977 0.433295737207 0.0492597628054 264 2397242.79826
30 changes: 17 additions & 13 deletions project_resstock_comed/pat.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"cluster_name": "resstock",
"connected": false,
"server_instance_type": {
"name": "c3.8xlarge",
"cpus": "32",
"memory": "60 GiB",
"storage": "2 x 320 GB",
"cost": "$1.68/hr"
"name": "d2.4xlarge",
"cpus": "16",
"memory": "122 GiB",
"storage": "12 x 2000 GB",
"cost": "$2.76/hr"
},
"worker_instance_type": {
"name": "c3.8xlarge",
Expand All @@ -25,7 +25,7 @@
"storage": "2 x 320 GB",
"cost": "$1.68/hr"
},
"user_id": "shorowit",
"user_id": "jrobert1",
"worker_node_number": 0,
"aws_tags": [],
"openstudio_server_version": {
Expand Down Expand Up @@ -56,10 +56,14 @@
"R": "3.2.3",
"ami": "ami-ff92b284"
},
"cluster_status": "terminated"
"cluster_status": "terminated",
"server": {
"dns": null
},
"open": false
},
"credentials": {
"yamlFilename": "resbldg_shorowit",
"yamlFilename": "jrobert1",
"accessKey": "AKIA****",
"region": "us-east-1"
},
Expand Down Expand Up @@ -276,7 +280,7 @@
"seed": "EmptySeedModel.osm",
"workflow_index": 0,
"options": [],
"instanceId": 0.06551810465395302,
"instanceId": 0.6562470748816203,
"skip": false,
"$$hashKey": "object:14896",
"showWarningText": false,
Expand Down Expand Up @@ -1187,7 +1191,7 @@
"seed": "EmptySeedModel.osm",
"workflow_index": 1,
"options": [],
"instanceId": 0.6707699712585036,
"instanceId": 0.4069783165126799,
"skip": false,
"$$hashKey": "object:12818",
"outputMeasure": true,
Expand Down Expand Up @@ -2666,7 +2670,7 @@
"seed": "EmptySeedModel.osm",
"workflow_index": 2,
"options": [],
"instanceId": 0.05147510083570661,
"instanceId": 0.823295809207176,
"skip": false,
"$$hashKey": "object:12817",
"outputMeasure": true,
Expand Down Expand Up @@ -3151,7 +3155,7 @@
"seed": "EmptySeedModel.osm",
"workflow_index": 3,
"options": [],
"instanceId": 0.01441200025813627,
"instanceId": 0.55298282452872,
"skip": false,
"$$hashKey": "object:119609",
"outputMeasure": false
Expand Down Expand Up @@ -3198,7 +3202,7 @@
"seed": "EmptySeedModel.osm",
"workflow_index": 4,
"options": [],
"instanceId": 0.682922874657842,
"instanceId": 0.0761227146787129,
"skip": false,
"$$hashKey": "object:663249",
"outputMeasure": false
Expand Down
5 changes: 3 additions & 2 deletions project_resstock_comed/resstock_cluster.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"cluster_name": "resstock",
"connected": false,
"server_instance_type": "c3.8xlarge",
"server_instance_type": "d2.4xlarge",
"worker_instance_type": "c3.8xlarge",
"user_id": "shorowit",
"user_id": "jrobert1",
"worker_node_number": 0,
"aws_tags": [],
"openstudio_server_version": "2.2.1-rc0",
"cluster_status": "terminated",
"server": {
"dns": null
},
"open": false,
"ami_lookup_version": 3
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[
"https://s3.amazonaws.com/epwweatherfiles/project_resstock_national.zip"
"https://s3.amazonaws.com/epwweatherfiles/project_resstock_comed.zip"
]
2 changes: 1 addition & 1 deletion project_resstock_comed/tests/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), "..", "..")
load 'Rakefile'

class TestResStockNational < MiniTest::Test
class TestResStockComed < MiniTest::Test

def test_housing_characteristics

Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
Dependency=Vintage Dependency=Geometry House Size Option=1 Car Option=2 Car Option=3 Car Option=None Count Weight
<1950 0-1499 0.1164626505 0.0298583839718 0.00244059918353 0.851238366345 593 5642881.19652
<1950 0-1499 0.1164626505 0.0322989831553 0.0 0.851238366345 593 5642881.19652
<1950 1500-2499 0.0757267292439 0.0962732592865 0.00488221505446 0.823117796415 450 4207616.55967
<1950 2500-3499 0.0865429067103 0.0910146670389 0.00586818917745 0.816574237073 193 1767455.92658
<1950 3500+ 0.138099566588 0.268283114023 0.0374321657038 0.556185153685 109 1013195.5589
1950s 0-1499 0.180179692973 0.130017143854 0.00462466829017 0.685178494883 520 4704980.71899
1950s 0-1499 0.180179692973 0.134641812144 0.0 0.685178494883 520 4704980.71899
1950s 1500-2499 0.230158290699 0.182913642499 0.00665871194548 0.580269354856 434 4078571.52665
1950s 2500-3499 0.222037994648 0.254086688543 0.0246509800383 0.49922433677 109 1046418.08394
1950s 3500+ 0.185978776614 0.44741322796 0.100933562203 0.265674433223 57 510967.971536
1960s 0-1499 0.20669281662 0.202071204758 0.00514634031405 0.586089638308 399 3677143.824
1960s 0-1499 0.20669281662 0.207217545072 0.0 0.586089638308 399 3677143.824
1960s 1500-2499 0.199143697427 0.357972541972 0.00391671926536 0.438967041336 353 3212853.73228
1960s 2500-3499 0.178482912826 0.502641566221 0.0170928373836 0.30178268357 119 1104859.16371
1960s 3500+ 0.0665206287453 0.661949539888 0.105823147622 0.165706683745 76 696651.587576
1970s 0-1499 0.158246029053 0.294197363051 0.00618905966727 0.541367548229 389 3453731.72908
1970s 0-1499 0.158246029053 0.300386422718 0.0 0.541367548229 389 3453731.72908
1970s 1500-2499 0.109832447933 0.502165494294 0.028268843838 0.359733213934 463 4007564.16903
1970s 2500-3499 0.0858198904404 0.653938899417 0.0363595268405 0.223881683302 188 1583212.84808
1970s 3500+ 0.0453163656317 0.663740177145 0.135690496294 0.15525296093 96 745789.220492
1980s 0-1499 0.132012751865 0.318533374124 0.0182267527079 0.531227121303 298 2859601.63218
1980s 0-1499 0.132012751865 0.336760126832 0.0 0.531227121303 298 2859601.63218
1980s 1500-2499 0.122063575957 0.567117480017 0.0257407657572 0.285078178269 416 3870139.65139
1980s 2500-3499 0.118214761459 0.661861719114 0.0820224660959 0.137901053331 182 1620047.60238
1980s 3500+ 0.0395432779553 0.672500139507 0.181011858396 0.106944724142 101 869421.62693
1990s 0-1499 0.0959243798256 0.305975061975 0.0072245784902 0.590875979709 246 2447476.30038
1990s 0-1499 0.0959243798256 0.313199640465 0.0 0.590875979709 246 2447476.30038
1990s 1500-2499 0.0491361593196 0.618715259278 0.0938821540725 0.23826642733 408 3900135.87119
1990s 2500-3499 0.049507105264 0.668065136442 0.150516059417 0.131911698877 236 2137182.2478
1990s 3500+ 0.0164542758168 0.60499967315 0.328130924039 0.0504151269945 212 1872290.29433
2000s 0-1499 0.0675339879945 0.511259041143 0.01872480476 0.402482166102 226 2268849.8469
2000s 0-1499 0.0675339879945 0.529983845903 0.0 0.402482166102 226 2268849.8469
2000s 1500-2499 0.0500198778183 0.670162901301 0.0899094034384 0.189907817442 423 3910028.52417
2000s 2500-3499 0.035942257118 0.657652113179 0.207084497227 0.0993211324763 243 2229392.98066
2000s 3500+ 0.0216221220102 0.495822377977 0.433295737207 0.0492597628054 264 2397242.79826
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
Dependency=Vintage Dependency=Geometry House Size Option=1 Car Option=2 Car Option=3 Car Option=None Count Weight
<1950 0-1499 0.1164626505 0.0298583839718 0.00244059918353 0.851238366345 593 5642881.19652
<1950 0-1499 0.1164626505 0.0322989831553 0.0 0.851238366345 593 5642881.19652
<1950 1500-2499 0.0757267292439 0.0962732592865 0.00488221505446 0.823117796415 450 4207616.55967
<1950 2500-3499 0.0865429067103 0.0910146670389 0.00586818917745 0.816574237073 193 1767455.92658
<1950 3500+ 0.138099566588 0.268283114023 0.0374321657038 0.556185153685 109 1013195.5589
1950s 0-1499 0.180179692973 0.130017143854 0.00462466829017 0.685178494883 520 4704980.71899
1950s 0-1499 0.180179692973 0.134641812144 0.0 0.685178494883 520 4704980.71899
1950s 1500-2499 0.230158290699 0.182913642499 0.00665871194548 0.580269354856 434 4078571.52665
1950s 2500-3499 0.222037994648 0.254086688543 0.0246509800383 0.49922433677 109 1046418.08394
1950s 3500+ 0.185978776614 0.44741322796 0.100933562203 0.265674433223 57 510967.971536
1960s 0-1499 0.20669281662 0.202071204758 0.00514634031405 0.586089638308 399 3677143.824
1960s 0-1499 0.20669281662 0.207217545072 0.0 0.586089638308 399 3677143.824
1960s 1500-2499 0.199143697427 0.357972541972 0.00391671926536 0.438967041336 353 3212853.73228
1960s 2500-3499 0.178482912826 0.502641566221 0.0170928373836 0.30178268357 119 1104859.16371
1960s 3500+ 0.0665206287453 0.661949539888 0.105823147622 0.165706683745 76 696651.587576
1970s 0-1499 0.158246029053 0.294197363051 0.00618905966727 0.541367548229 389 3453731.72908
1970s 0-1499 0.158246029053 0.300386422718 0.0 0.541367548229 389 3453731.72908
1970s 1500-2499 0.109832447933 0.502165494294 0.028268843838 0.359733213934 463 4007564.16903
1970s 2500-3499 0.0858198904404 0.653938899417 0.0363595268405 0.223881683302 188 1583212.84808
1970s 3500+ 0.0453163656317 0.663740177145 0.135690496294 0.15525296093 96 745789.220492
1980s 0-1499 0.132012751865 0.318533374124 0.0182267527079 0.531227121303 298 2859601.63218
1980s 0-1499 0.132012751865 0.336760126832 0.0 0.531227121303 298 2859601.63218
1980s 1500-2499 0.122063575957 0.567117480017 0.0257407657572 0.285078178269 416 3870139.65139
1980s 2500-3499 0.118214761459 0.661861719114 0.0820224660959 0.137901053331 182 1620047.60238
1980s 3500+ 0.0395432779553 0.672500139507 0.181011858396 0.106944724142 101 869421.62693
1990s 0-1499 0.0959243798256 0.305975061975 0.0072245784902 0.590875979709 246 2447476.30038
1990s 0-1499 0.0959243798256 0.313199640465 0.0 0.590875979709 246 2447476.30038
1990s 1500-2499 0.0491361593196 0.618715259278 0.0938821540725 0.23826642733 408 3900135.87119
1990s 2500-3499 0.049507105264 0.668065136442 0.150516059417 0.131911698877 236 2137182.2478
1990s 3500+ 0.0164542758168 0.60499967315 0.328130924039 0.0504151269945 212 1872290.29433
2000s 0-1499 0.0675339879945 0.511259041143 0.01872480476 0.402482166102 226 2268849.8469
2000s 0-1499 0.0675339879945 0.529983845903 0.0 0.402482166102 226 2268849.8469
2000s 1500-2499 0.0500198778183 0.670162901301 0.0899094034384 0.189907817442 423 3910028.52417
2000s 2500-3499 0.035942257118 0.657652113179 0.207084497227 0.0993211324763 243 2229392.98066
2000s 3500+ 0.0216221220102 0.495822377977 0.433295737207 0.0492597628054 264 2397242.79826

0 comments on commit f4b1e58

Please sign in to comment.