@@ -326,6 +326,8 @@ def policy_activated(policy_loc, policy_nm, scenario):
326
326
if key != "jobs_housing_com_for_res_scenarios" :
327
327
counter += 1
328
328
write ("Jobs-housing fees are activated for %d counties" % counter )
329
+ else :
330
+ write ("Jobs-housing fees are not activated" )
329
331
write ("" )
330
332
331
333
# affordable housing bonds
@@ -350,12 +352,13 @@ def policy_activated(policy_loc, policy_nm, scenario):
350
352
amount = float (policy_loc ["total_amount_db" ])
351
353
elif scenario in policy_loc ["alternate_amount_scenarios_db" ]:
352
354
amount = float (policy_loc ["alternate_total_amount_db" ])
353
- else :
355
+ elif scenario in (policy ["acct_settings" ]["lump_sum_accounts" ]
356
+ [county + "_bond_settings" ]["enable_in_scenarios" ]):
354
357
amount = float (policy_loc ["total_amount" ])
355
- # sum annual ammount over the simulation period
356
- regional_funding += amount * 5 * 7
357
- write ( "Total funding for deed-restricted housing is $%d"
358
- % regional_funding )
358
+ # sum annual amount over the simulation period
359
+ if ' amount' in locals ():
360
+ regional_funding += amount * 5 * 7
361
+ write ( "Total funding is $%d" % regional_funding )
359
362
360
363
f .close ()
361
364
@@ -407,8 +410,9 @@ def topsheet(households, jobs, buildings, parcels, zones, year,
407
410
# round to nearest 100s
408
411
hhincome_by_intrich = (hhincome_by_intrich / 100 ).round ()* 100
409
412
410
- # Summaries for Draft Blueprint geographies
411
- if scenario in policy ["geographies_db_enable" ]:
413
+ # Summaries for Draft/Final Blueprint geographies
414
+ if scenario in policy ["geographies_db_enable" ] or \
415
+ scenario in policy ["geographies_fb_enable" ]:
412
416
hh_by_inpda_pba50 = households_df .pda_id_pba50 .notnull ().value_counts ()
413
417
414
418
hhincome_by_inpda_pba50 = households_df .income .groupby (
@@ -449,7 +453,8 @@ def topsheet(households, jobs, buildings, parcels, zones, year,
449
453
if scenario in policy ["geographies_fr2_enable" ]:
450
454
jobs_by_intrich = jobs_df .trich_id .notnull ().value_counts ()
451
455
452
- if scenario in policy ["geographies_db_enable" ]:
456
+ if scenario in policy ["geographies_db_enable" ] or \
457
+ scenario in policy ["geographies_fb_enable" ]:
453
458
jobs_by_inpda_pba50 = jobs_df .pda_pba50 .notnull ().value_counts ()
454
459
jobs_by_intra = jobs_df .tra_id .notnull ().value_counts ()
455
460
@@ -478,7 +483,8 @@ def topsheet(households, jobs, buildings, parcels, zones, year,
478
483
"hhincome_by_intrich" : hhincome_by_intrich ,
479
484
"capacity" : capacity
480
485
})
481
- if scenario in policy ["geographies_db_enable" ]:
486
+ if scenario in policy ["geographies_db_enable" ] or \
487
+ scenario in policy ["geographies_fb_enable" ]:
482
488
orca .add_injectable ("base_year_measures" , {
483
489
"hh_by_subregion" : hh_by_subregion ,
484
490
"jobs_by_subregion" : jobs_by_subregion ,
@@ -562,6 +568,16 @@ def norm_and_round(s):
562
568
write ("Draft Blueprint year mean income by whether household\
563
569
is in hra/dr:\n %s" % hhincome_by_insesit )
564
570
571
+ if scenario in policy ["geographies_fb_enable" ]:
572
+ write ("Base year mean income by whether household is in tra:\n %s" %
573
+ base_year_measures ["hhincome_by_intra" ])
574
+ write ("Final Blueprint year mean income by whether household\
575
+ is in tra:\n %s" % hhincome_by_intra )
576
+ write ("Base year mean income by whether household is in hra/dr:\n %s" %
577
+ base_year_measures ["hhincome_by_insesit" ])
578
+ write ("Final Blueprint year mean income by whether household\
579
+ is in hra/dr:\n %s" % hhincome_by_insesit )
580
+
565
581
jsp = buildings .job_spaces .sum ()
566
582
write ("Number of job spaces = %d" % jsp )
567
583
write ("Non-residential vacancy rate = %.2f" % (1 - 0 - float (nj )/ jsp ))
@@ -658,8 +674,9 @@ def norm_and_round(s):
658
674
write ("Jobs pct of regional growth in trichs:\n %s" %
659
675
norm_and_round (diff ))
660
676
661
- # write Draft Blueprint additional summaries: pda, tra, sesit(hra/dr)
662
- if scenario in policy ["geographies_db_enable" ]:
677
+ # write Draft/Final Blueprint additional summaries: pda, tra, sesit(hra/dr)
678
+ if scenario in policy ["geographies_db_enable" ] or \
679
+ scenario in policy ["geographies_fb_enable" ]:
663
680
tmp = base_year_measures ["hh_by_inpda_pba50" ]
664
681
write ("Households base year share in pdas:\n %s" %
665
682
norm_and_round (tmp ))
@@ -952,10 +969,12 @@ def geographic_summary(parcels, households, jobs, buildings, taz_geography,
952
969
(scenario in policy ["geographies_fr2_enable" ]):
953
970
geographies .append ('juris_trich' )
954
971
955
- # append Draft Blueprint strategy geographis
956
- if scenario in policy ["geographies_db_enable" ]:
957
- geographies .extend (['pda_pba50' , 'juris_tra' ,
958
- 'juris_sesit' , 'juris_ppa' ])
972
+ # disable final blueprint summaries being handled in post processing summaries
973
+ # # append Draft/Final Blueprint strategy geographis
974
+ # if scenario in policy["geographies_db_enable"] or \
975
+ # scenario in policy["geographies_fb_enable"]:
976
+ # geographies.extend(['pda_pba50', 'juris_tra',
977
+ # 'juris_sesit', 'juris_ppa'])
959
978
960
979
if year in [2010 , 2015 , 2020 , 2025 , 2030 , 2035 , 2040 , 2045 , 2050 ]:
961
980
@@ -1168,10 +1187,11 @@ def building_summary(parcels, run_number, year,
1168
1187
df = orca .merge_tables (
1169
1188
'buildings' ,
1170
1189
[parcels , buildings ],
1171
- columns = ['performance_zone' , 'year_built' , 'residential_units' ,
1172
- 'unit_price' , 'zone_id' , 'non_residential_sqft' ,
1173
- 'deed_restricted_units' , 'job_spaces' , 'x' , 'y' , 'geom_id' ,
1174
- 'source' ])
1190
+ columns = ['performance_zone' , 'year_built' , 'building_type' ,
1191
+ 'residential_units' , 'unit_price' , 'zone_id' ,
1192
+ 'non_residential_sqft' , 'vacant_res_units' ,
1193
+ 'deed_restricted_units' , 'job_spaces' ,
1194
+ 'x' , 'y' , 'geom_id' , 'source' ])
1175
1195
1176
1196
df .to_csv (
1177
1197
os .path .join ("runs" , "run%d_building_data_%d.csv" %
@@ -1191,7 +1211,6 @@ def parcel_summary(parcels, buildings, households, jobs,
1191
1211
df = parcels .to_frame ([
1192
1212
"geom_id" ,
1193
1213
"x" , "y" ,
1194
- "total_residential_units" ,
1195
1214
"total_job_spaces" ,
1196
1215
"first_building_type"
1197
1216
])
@@ -1225,6 +1244,15 @@ def parcel_summary(parcels, buildings, households, jobs,
1225
1244
parcel_id .value_counts ()
1226
1245
df ["tothh" ] = households_df .groupby ('parcel_id' ).size ()
1227
1246
1247
+ building_df = orca .merge_tables (
1248
+ 'buildings' ,
1249
+ [parcels , buildings ],
1250
+ columns = ['parcel_id' , 'residential_units' , 'deed_restricted_units' ])
1251
+ df ['residential_units' ] = \
1252
+ building_df .groupby ('parcel_id' )['residential_units' ].sum ()
1253
+ df ['deed_restricted_units' ] = \
1254
+ building_df .groupby ('parcel_id' )['deed_restricted_units' ].sum ()
1255
+
1228
1256
jobs_df = orca .merge_tables (
1229
1257
'jobs' ,
1230
1258
[buildings , jobs ],
0 commit comments