Skip to content

Commit 1852f8a

Browse files
committed
handle recoding
1 parent 5d95f6d commit 1852f8a

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

configs/settings.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ input_table_list:
5656
# The index column is set before keep_columns,
5757
# so don't put index in keep columns
5858
index_col: zone_id
59-
# rename_columns:
60-
#
59+
recode_columns:
60+
zone_id: zero-based
6161
keep_columns:
6262
#- TAZ
6363
# - construc

configs/stop_frequency_annotate_tours_preprocessor.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Number of subtours in the tour,num_atwork_subtours,"df.atwork_subtour_frequency.
3333
#,,
3434
Number of hh shop tours including joint,num_hh_shop_tours,"reindex_i(df[df.tour_type==SHOP_TOUR].groupby('household_id').size(), df.person_id)"
3535
Number of hh maint tours including joint,num_hh_maint_tours,"reindex_i(df[df.tour_type==MAINT_TOUR].groupby('household_id').size(), df.person_id)"
36-
tourStartsInPeakPeriod,_tour_starts_in_peak,(network_los.skim_time_period_label(df.start) == 'AM') | (network_los.skim_time_period_label(df.start) == 'PM')
36+
tourStartsInPeakPeriod,_tour_starts_in_peak,(network_los.skim_time_period_label(df.start) == 'AM') | (network_los.skim_time_period_label(df.start) == 'PM') | (network_los.skim_time_period_label(df.start) == 1) | (network_los.skim_time_period_label(df.start) == 3)
3737
AccesibilityAtOrigin fallback,hhacc,0
3838
AccesibilityAtOrigin if transit,hhacc,"hhacc.where(~tour_mode_is_transit, df.trPkRetail.where(_tour_starts_in_peak, df.trOpRetail))"
3939
AccesibilityAtOrigin if non_motorized,hhacc,"hhacc.where(~tour_mode_is_non_motorized, df.nmRetail)"

configs/trip_mode_choice.csv

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,14 @@ PAYMODE - Constants,"@np.where((c_filter_atwrk == 0), (c_ivt)*(pay_md_cons), 0)"
196196
#MARTA Constants,,,,,,,,,,,,,,,,
197197
MARTA CONSTANT - Walk All Transit,"@c_ivt*np.minimum(odt_skims['WLK_ALLTRN_WLK_HRT'], 15)*(-1)*(0.1)",,,,,,,,,1,,,,,,
198198
MARTA CONSTANT - Walk Premium,"@c_ivt*np.minimum(odt_skims['WLK_PRMTRN_WLK_HRT'], 15)*(-1)*(0.1)",,,,,,,,,,1,,,,,
199-
MARTA CONSTANT - PNR All Transit - Outbound Leg of Tour,"@df.outbound *c_ivt*np.minimum(odt_skims['PNR_ALLTRN_WLK_HRT'], 15)*(-1)*(0.1)*(df.trip_period.isin(['EA','AM','MD']))*(c_filter_atwrk == 0)",,,,,,,,,,,1,,,,
200-
MARTA CONSTANT - PNR All Transit - Inbound Leg of Tour,"@df.inbound *c_ivt*np.minimum(dot_skims['WLK_ALLTRN_PNR_HRT'], 15)*(-1)*(0.1)*(df.trip_period.isin(['PM','EV']))*(c_filter_atwrk == 0)",,,,,,,,,,,1,,,,
201-
MARTA CONSTANT - PNR Premium - Outbound Leg of Tour,"@df.outbound *c_ivt*np.minimum(odt_skims['PNR_PRMTRN_WLK_HRT'], 15)*(-1)*(0.1)*(df.trip_period.isin(['EA','AM','MD']))*(c_filter_atwrk == 0)",,,,,,,,,,,,1,,,
202-
MARTA CONSTANT - PNR Premium - Inbound Leg of Tour,"@df.inbound * c_ivt*np.minimum(dot_skims['WLK_PRMTRN_PNR_HRT'], 15)*(-1)*(0.1)*(df.trip_period.isin(['PM','EV']))*(c_filter_atwrk == 0)",,,,,,,,,,,,1,,,
203-
MARTA CONSTANT - KNR All Transit - Outbound Leg of Tour,"@df.outbound *c_ivt*np.minimum(odt_skims['KNR_ALLTRN_WLK_HRT'], 15)*(-1)*(0.1)*(df.trip_period.isin(['EA','AM','MD']))*(c_filter_atwrk == 0)",,,,,,,,,,,,,1,,
204-
MARTA CONSTANT - KNR All Transit - Inbound Leg of Tour,"@df.inbound * c_ivt*np.minimum(dot_skims['WLK_ALLTRN_KNR_HRT'], 15)*(-1)*(0.1)*(df.trip_period.isin(['PM','EV']))*(c_filter_atwrk == 0)",,,,,,,,,,,,,1,,
205-
MARTA CONSTANT - KNR Premium - Outbound Leg of Tour,"@df.outbound * c_ivt*np.minimum(odt_skims['KNR_PRMTRN_WLK_HRT'], 15)*(-1)*(0.1)*(df.trip_period.isin(['EA','AM','MD']))*(c_filter_atwrk == 0)",,,,,,,,,,,,,,1,
206-
MARTA CONSTANT - KNR Premium - Inbound Leg of Tour,"@df.inbound * c_ivt*np.minimum(dot_skims['WLK_PRMTRN_KNR_HRT'], 15)*(-1)*(0.1)*(df.trip_period.isin(['PM','EV']))*(c_filter_atwrk == 0)",,,,,,,,,,,,,,1,
199+
MARTA CONSTANT - PNR All Transit - Outbound Leg of Tour,"@df.outbound *c_ivt*np.minimum(odt_skims['PNR_ALLTRN_WLK_HRT'], 15)*(-1)*(0.1)*(df.is_out_period)*(c_filter_atwrk == 0)",,,,,,,,,,,1,,,,
200+
MARTA CONSTANT - PNR All Transit - Inbound Leg of Tour,"@df.inbound *c_ivt*np.minimum(dot_skims['WLK_ALLTRN_PNR_HRT'], 15)*(-1)*(0.1)*(df.is_in_period)*(c_filter_atwrk == 0)",,,,,,,,,,,1,,,,
201+
MARTA CONSTANT - PNR Premium - Outbound Leg of Tour,"@df.outbound *c_ivt*np.minimum(odt_skims['PNR_PRMTRN_WLK_HRT'], 15)*(-1)*(0.1)*(df.is_out_period)*(c_filter_atwrk == 0)",,,,,,,,,,,,1,,,
202+
MARTA CONSTANT - PNR Premium - Inbound Leg of Tour,"@df.inbound * c_ivt*np.minimum(dot_skims['WLK_PRMTRN_PNR_HRT'], 15)*(-1)*(0.1)*(df.is_in_period)*(c_filter_atwrk == 0)",,,,,,,,,,,,1,,,
203+
MARTA CONSTANT - KNR All Transit - Outbound Leg of Tour,"@df.outbound *c_ivt*np.minimum(odt_skims['KNR_ALLTRN_WLK_HRT'], 15)*(-1)*(0.1)*(df.is_out_period)*(c_filter_atwrk == 0)",,,,,,,,,,,,,1,,
204+
MARTA CONSTANT - KNR All Transit - Inbound Leg of Tour,"@df.inbound * c_ivt*np.minimum(dot_skims['WLK_ALLTRN_KNR_HRT'], 15)*(-1)*(0.1)*(df.is_in_period)*(c_filter_atwrk == 0)",,,,,,,,,,,,,1,,
205+
MARTA CONSTANT - KNR Premium - Outbound Leg of Tour,"@df.outbound * c_ivt*np.minimum(odt_skims['KNR_PRMTRN_WLK_HRT'], 15)*(-1)*(0.1)*(df.is_out_period)*(c_filter_atwrk == 0)",,,,,,,,,,,,,,1,
206+
MARTA CONSTANT - KNR Premium - Inbound Leg of Tour,"@df.inbound * c_ivt*np.minimum(dot_skims['WLK_PRMTRN_KNR_HRT'], 15)*(-1)*(0.1)*(df.is_in_period)*(c_filter_atwrk == 0)",,,,,,,,,,,,,,1,
207207
#,,,,,,,,,,,,,,,,
208208
Walk Transit Short Distance Disutility,"@c_ivt*np.minimum(np.maximum((-3*odt_skims['SOV_FREE_DISTANCE']+40),0),30)",,,,,,,,,1,1,,,,,
209209
#,,,,,,,,,,,,,,,,

configs/trip_mode_choice_annotate_trips_preprocessor.csv

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ free parking availability,free_parking_available,(df.tour_type == 'work') & df.f
1313
#cost coefficients,,
1414
,c_cost,(c_cost_low * df.is_low_income)+(c_cost_med * df.is_medium_income)+(c_cost_high * df.is_high_income)+(c_cost_high * df.is_very_high_income)
1515
#,,
16-
is_morning_period,_out_period,"(df.trip_period.isin(['EA','AM','MD']))"
17-
is_afternoon_period,_in_period,"(df.trip_period.isin(['MD','PM']))"
16+
is_morning_period,_out_period,"(df.trip_period.isin(['EA','AM','MD', 0, 1, 2]))"
17+
is_afternoon_period,_in_period,"(df.trip_period.isin(['MD','PM', 2, 3]))"
18+
,is_out_period,_out_period
19+
,is_in_period,_in_period
1820
#,,
1921
WLKALL transit in-vehicle time - outbound direction,walk_allTransit_ivt,odt_skims['WLK_ALLTRN_WLK_LOCAL']+expr*odt_skims['WLK_ALLTRN_WLK_XBUS']+hrt*odt_skims['WLK_ALLTRN_WLK_HRT']+brt*odt_skims['WLK_ALLTRN_WLK_BRT']+lrt*odt_skims['WLK_ALLTRN_WLK_LRT']+crl*odt_skims['WLK_ALLTRN_WLK_COMRAIL']
2022
WLKPRM transit in-vehicle time - outbound direction,walk_prmTransit_ivt,odt_skims['WLK_PRMTRN_WLK_LOCAL']+expr*odt_skims['WLK_PRMTRN_WLK_XBUS']+hrt*odt_skims['WLK_PRMTRN_WLK_HRT']+brt*odt_skims['WLK_PRMTRN_WLK_BRT']+lrt*odt_skims['WLK_PRMTRN_WLK_LRT']+crl*odt_skims['WLK_PRMTRN_WLK_COMRAIL']

0 commit comments

Comments
 (0)