Skip to content

Commit f32ade0

Browse files
committed
add 2035 high-quality transit stop summary
1 parent 93eb0ee commit f32ade0

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

scripts/metrics/metrics_connected.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ def transit_service_area_share_v2(
444444
"NP":'np',
445445
"Plus": "dbp",
446446
"Final Blueprint": "fbp",
447+
"Final Blueprint 2035": "fbp2035", # added for final SCS submittal
447448
"Draft Blueprint": "dbp",
448449
"DBP": "dbp",
449450
"Alt1": "fbp",
@@ -460,7 +461,6 @@ def transit_service_area_share_v2(
460461

461462
logging.info(f"Calculating connected for {modelrun_alias} / {modelrun_id}")
462463
logging.debug(f"Modelrun data years: {modelrun_data.keys()}")
463-
logging.debug(f"Modelrun data 2050 datasets: {modelrun_data[2050].keys()}")
464464

465465
# convenience function for easy groupby percentages
466466
def pct(x):
@@ -535,13 +535,22 @@ def groupby_summaries(df, group_vars):
535535
logging.info(f'Skipping {year} for {modelrun_alias}.')
536536
continue
537537

538-
# Skip any other years
538+
# Skip any other years except for year 2035 for Final Blueprint
539+
elif year == 2035:
540+
if modelrun_alias in ['Final Blueprint']:
541+
logging.info(f'Processing {year} for {modelrun_alias}.')
542+
else:
543+
logging.info(f'Skipping {year} for {modelrun_alias}.')
539544
else:
540545
logging.info(f'Skipping {year} for {modelrun_alias}.')
541-
continue
542546

543547
# Continue processing for each year and scenario
544-
transit_scenario = transit_scenario_mapping.get(modelrun_alias, 'fbp') # Set default to fbp
548+
if (year == 2035) & (modelrun_alias == 'Final Blueprint'):
549+
transit_scenario = "fbp2035"
550+
else:
551+
transit_scenario = transit_scenario_mapping.get(modelrun_alias, 'fbp') # Set default to fbp
552+
553+
logging.debug(f"Modelrun data {year} datasets: {modelrun_data[year].keys()}")
545554
parcel_output = modelrun_data[year]["parcel"].copy(deep=True)
546555
# report shape of parcel_output df
547556
len_parcels = len(parcel_output)

scripts/metrics/metrics_utils.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,10 @@
7474
USERNAME = getpass.getuser()
7575
HOME_DIR = pathlib.Path.home()
7676

77-
if USERNAME.lower() in ['lzorn', 'jahrenholtz']: # need to standardize to E:Box
77+
if USERNAME.lower() in ['lzorn', 'jahrenholtz', 'ywang']: # need to standardize to E:Box
7878
BOX_DIR = pathlib.Path("E:/Box")
7979
elif USERNAME.lower() in ['aolsen']:
8080
BOX_DIR = HOME_DIR /'Library/CloudStorage/Box-Box'
81-
elif USERNAME.lower() in ['ywang']:
82-
BOX_DIR = pathlib.Path("C:/Users/ywang/Box")
8381
else:
8482
BOX_DIR = HOME_DIR / 'Box'
8583

@@ -255,8 +253,8 @@ def load_data_for_runs(
255253
import geopandas as gpd
256254
PARCEL_TRANSITSERVICE_FILE = pathlib.Path(BOX_DIR, 'Modeling and Surveys', 'Urban Modeling',
257255
'Spatial', 'transit', 'transit_service_levels', 'update_2025', 'outputs',
258-
'parcels10_x_high_quality_stop_buffer.csv')
259-
rtp2025_transit_service_df = pd.read_csv(PARCEL_TRANSITSERVICE_FILE, usecols=['parcel_id', 'cur', 'np', 'dbp', 'fbp'])
256+
'parcels10_x_high_quality_stop_buffer_with2035.csv')
257+
rtp2025_transit_service_df = pd.read_csv(PARCEL_TRANSITSERVICE_FILE, usecols=['parcel_id', 'cur', 'np', 'dbp', 'fbp', 'fbp2035'])
260258
logging.info(" Read {:,} rows from crosswalk {}".format(len(rtp2025_transit_service_df), PARCEL_TRANSITSERVICE_FILE))
261259
logging.debug(" rtp2025_transit_service_df.head():\n{}".format(rtp2025_transit_service_df.head()))
262260

@@ -909,7 +907,7 @@ def load_data_for_runs(
909907
'tract10_epc', 'tract10_DispRisk', 'tract10_hra', 'tract10_growth_geo', 'tract10_tra',
910908

911909
# transit-related columns
912-
'np','dbp','fbp',
910+
'np','dbp','fbp','fbp2035',
913911

914912
# sea level rise column
915913
"inundation"]

0 commit comments

Comments
 (0)