diff --git a/configs/logging.yaml b/configs/logging.yaml index 3b1bfdd..3c20ffe 100644 --- a/configs/logging.yaml +++ b/configs/logging.yaml @@ -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: @@ -37,7 +46,7 @@ logging: console: class: logging.StreamHandler stream: ext://sys.stdout - formatter: simpleFormatter + formatter: elapsedFormatter level: NOTSET formatters: @@ -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: '{' diff --git a/configs/settings.yaml b/configs/settings.yaml index 785c376..8ed7275 100644 --- a/configs/settings.yaml +++ b/configs/settings.yaml @@ -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 @@ -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 @@ -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] diff --git a/configs/stop_frequency_annotate_tours_preprocessor.csv b/configs/stop_frequency_annotate_tours_preprocessor.csv index 4f901d6..3533588 100644 --- a/configs/stop_frequency_annotate_tours_preprocessor.csv +++ b/configs/stop_frequency_annotate_tours_preprocessor.csv @@ -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)" diff --git a/configs/trip_mode_choice.csv b/configs/trip_mode_choice.csv index 2ba519f..556b0b0 100644 --- a/configs/trip_mode_choice.csv +++ b/configs/trip_mode_choice.csv @@ -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,,,,, #,,,,,,,,,,,,,,,, diff --git a/configs/trip_mode_choice_annotate_trips_preprocessor.csv b/configs/trip_mode_choice_annotate_trips_preprocessor.csv index 3e55f25..ce0109b 100644 --- a/configs/trip_mode_choice_annotate_trips_preprocessor.csv +++ b/configs/trip_mode_choice_annotate_trips_preprocessor.csv @@ -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'] diff --git a/data/.gitignore b/data/.gitignore new file mode 100644 index 0000000..8bc6907 --- /dev/null +++ b/data/.gitignore @@ -0,0 +1,3 @@ +*.csv +*.omx +*.zip