Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for sharrow compatibility #2

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion configs/logging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ logging:
handlers: [console, logfile]
propagate: false

black:
# sharrow uses black to reformat code, but we don't generally care
# about messages emitted by black unless they are serious
level: WARN

blib2to3:
# this is a vendored library within black that we also want to squelch
level: WARN

handlers:

logfile:
Expand All @@ -37,7 +46,7 @@ logging:
console:
class: logging.StreamHandler
stream: ext://sys.stdout
formatter: simpleFormatter
formatter: elapsedFormatter
level: NOTSET

formatters:
Expand All @@ -53,3 +62,7 @@ logging:
format: '%(asctime)s - %(levelname)s - %(name)s - %(message)s'
datefmt: '%d/%m/%Y %H:%M:%S'

elapsedFormatter:
(): activitysim.core.tracing.ElapsedTimeFormatter
format: '[{elapsedTime}] {levelname:s}: {message:s}'
style: '{'
31 changes: 24 additions & 7 deletions configs/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ input_table_list:
maz: home_zone_id
np: hhsize
nwrkrs_esr: num_workers
recode_columns:
home_zone_id: land_use.zone_id
keep_columns:
#- household_id
- home_zone_id
Expand Down Expand Up @@ -56,8 +58,8 @@ input_table_list:
# The index column is set before keep_columns,
# so don't put index in keep columns
index_col: zone_id
# rename_columns:
#
recode_columns:
zone_id: zero-based
keep_columns:
#- TAZ
# - construc
Expand Down Expand Up @@ -198,11 +200,26 @@ output_tables:
tables:
- checkpoints
- accessibility
- land_use
- households
- persons
- tours
- trips
- tablename: land_use
decode_columns:
zone_id: land_use.zone_id
- tablename: households
decode_columns:
home_zone_id: land_use.zone_id
- tablename: persons
decode_columns:
home_zone_id: land_use.zone_id
school_zone_id: nonnegative | land_use.zone_id
workplace_zone_id: nonnegative | land_use.zone_id
- tablename: tours
decode_columns:
origin: land_use.zone_id
destination: land_use.zone_id
- tablename: trips
decode_columns:
origin: land_use.zone_id
destination: land_use.zone_id
parking_zone_id: nonnegative | land_use.zone_id
- joint_tour_participants

# trace_od: [100,10]
Expand Down
2 changes: 1 addition & 1 deletion configs/stop_frequency_annotate_tours_preprocessor.csv
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Number of subtours in the tour,num_atwork_subtours,"df.atwork_subtour_frequency.
#,,
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)"
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)"
tourStartsInPeakPeriod,_tour_starts_in_peak,(network_los.skim_time_period_label(df.start) == 'AM') | (network_los.skim_time_period_label(df.start) == 'PM')
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)
AccesibilityAtOrigin fallback,hhacc,0
AccesibilityAtOrigin if transit,hhacc,"hhacc.where(~tour_mode_is_transit, df.trPkRetail.where(_tour_starts_in_peak, df.trOpRetail))"
AccesibilityAtOrigin if non_motorized,hhacc,"hhacc.where(~tour_mode_is_non_motorized, df.nmRetail)"
Expand Down
16 changes: 8 additions & 8 deletions configs/trip_mode_choice.csv
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,14 @@ PAYMODE - Constants,"@np.where((c_filter_atwrk == 0), (c_ivt)*(pay_md_cons), 0)"
#MARTA Constants,,,,,,,,,,,,,,,,
MARTA CONSTANT - Walk All Transit,"@c_ivt*np.minimum(odt_skims['WLK_ALLTRN_WLK_HRT'], 15)*(-1)*(0.1)",,,,,,,,,1,,,,,,
MARTA CONSTANT - Walk Premium,"@c_ivt*np.minimum(odt_skims['WLK_PRMTRN_WLK_HRT'], 15)*(-1)*(0.1)",,,,,,,,,,1,,,,,
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,,,,
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,,,,
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,,,
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,,,
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,,
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,,
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,
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,
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,,,,
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,,,,
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,,,
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,,,
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,,
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,,
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,
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,
#,,,,,,,,,,,,,,,,
Walk Transit Short Distance Disutility,"@c_ivt*np.minimum(np.maximum((-3*odt_skims['SOV_FREE_DISTANCE']+40),0),30)",,,,,,,,,1,1,,,,,
#,,,,,,,,,,,,,,,,
Expand Down
6 changes: 4 additions & 2 deletions configs/trip_mode_choice_annotate_trips_preprocessor.csv
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ free parking availability,free_parking_available,(df.tour_type == 'work') & df.f
#cost coefficients,,
,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)
#,,
is_morning_period,_out_period,"(df.trip_period.isin(['EA','AM','MD']))"
is_afternoon_period,_in_period,"(df.trip_period.isin(['MD','PM']))"
is_morning_period,_out_period,"(df.trip_period.isin(['EA','AM','MD', 0, 1, 2]))"
is_afternoon_period,_in_period,"(df.trip_period.isin(['MD','PM', 2, 3]))"
,is_out_period,_out_period
,is_in_period,_in_period
#,,
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']
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']
Expand Down
3 changes: 3 additions & 0 deletions data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.csv
*.omx
*.zip