diff --git a/configs/resident/cdap.yaml b/configs/resident/cdap.yaml index ea6ae20..d7e3600 100644 --- a/configs/resident/cdap.yaml +++ b/configs/resident/cdap.yaml @@ -45,3 +45,6 @@ annotate_households: DF: households TABLES: - persons + +sharrow_settings: + skip: true diff --git a/configs/resident/mandatory_tour_scheduling.yaml b/configs/resident/mandatory_tour_scheduling.yaml index ea9ca0a..14fd479 100644 --- a/configs/resident/mandatory_tour_scheduling.yaml +++ b/configs/resident/mandatory_tour_scheduling.yaml @@ -30,6 +30,10 @@ TOUR_SPEC_SEGMENTS: school: school univ: univ +preprocessor: + SPEC: mandatory_tour_scheduling_annotate_choosers_preprocessor.csv + DF: df + ALTS_PREPROCESSOR: work: SPEC: mandatory_tour_scheduling_annotate_alts_preprocessor.csv diff --git a/configs/resident/mandatory_tour_scheduling_annotate_choosers_preprocessor.csv b/configs/resident/mandatory_tour_scheduling_annotate_choosers_preprocessor.csv new file mode 100644 index 0000000..9b6fde9 --- /dev/null +++ b/configs/resident/mandatory_tour_scheduling_annotate_choosers_preprocessor.csv @@ -0,0 +1,3 @@ +Description,Target,Expression +subsequent_tour_is_work,subsequent_tour_is_work,df.tour_type.shift(-1) == 'work' +subsequent_tour_is_school,subsequent_tour_is_school,df.tour_type.shift(-1) == 'school' diff --git a/configs/resident/tour_scheduling_school.csv b/configs/resident/tour_scheduling_school.csv index 6470156..c40ba42 100644 --- a/configs/resident/tour_scheduling_school.csv +++ b/configs/resident/tour_scheduling_school.csv @@ -25,11 +25,11 @@ util_All_adults_in_the_household_are_fulltime_workers_Departure_before_730_am__L util_All_adults_in_the_household_are_fulltime_workers_Departure_after_800_am_Linear,SCHOOL - All adults in the household are fulltime workers - Departure after 8:00 am - Linear,"@((df.is_all_adults_full_time_workers) & (df.start > df.departureRefBin_school)) *df.departureLinearShift1",coef_All_adults_in_the_household_are_fulltime_workers_Departure_after_800_am_Linear util_All_adults_in_the_household_are_fulltime_workers_arrival_before_ref,SCHOOL - All adults in the household are fulltime workers - Duration < 8hrs,"@((df.is_all_adults_full_time_workers) & (df.end < df.arrivalRefBin_school)) * df.arrivalLinearShift1_school",coef_All_adults_in_the_household_are_fulltime_workers_arrival_before_ref util_All_adults_in_the_household_are_fulltime_workers_arrival_after_ref,SCHOOL - All adults in the household are fulltime workers - Duration > 8hrs,"@((df.is_all_adults_full_time_workers) & (df.end > df.arrivalRefBin_school)) * df.arrivalLinearShift1_school",coef_All_adults_in_the_household_are_fulltime_workers_arrival_after_ref -util_Subsequent_tour_is_work_tour_Duration_lt_8_hours,SCHOOL - Subsequent tour is work tour: Duration < 8 hours,"@(((df.tour_count>1) & (df.tour_num == 1) & (df.tour_type.shift(-1) == 'work') & (df.start < df.durationRefBin_school))) * df.durationShift_school",coef_Subsequent_tour_is_work_tour_Duration_lt_8_hours -util_Subsequent_tour_is_work_tour_Duration_gt_8_hours,SCHOOL - Subsequent tour is work tour: Duration > 8 hours,"@(((df.tour_count>1) & (df.tour_num == 1) & (df.tour_type.shift(-1) == 'work') & (df.start > df.durationRefBin_school))) * df.durationShift_school",coef_Subsequent_tour_is_work_tour_Duration_gt_8_hours -util_Subsequent_tour_is_school_tour_Departure_after_800_am,SCHOOL - Subsequent tour is school tour: Departure after 8:00 am,"@(((df.tour_count>1) & (df.tour_num == 1) & (df.tour_type.shift(-1) == 'school') & (df.start > df.departureRefBin_school))) *df.departureLinearShift1",coef_Subsequent_tour_is_school_tour_Departure_after_800_am -util_Subsequent_tour_is_school_tour_Duration_lt_8_hours,SCHOOL - Subsequent tour is school tour: Duration < 8 hours,"@(((df.tour_count>1) & (df.tour_num == 1) & (df.tour_type.shift(-1) == 'school') & (df.start < df.durationRefBin_school))) * df.durationShift_school",coef_Subsequent_tour_is_school_tour_Duration_lt_8_hours -util_Subsequent_tour_is_school_tour_Duration_gt_8_hours,SCHOOL - Subsequent tour is school tour: Duration > 8 hours,"@(((df.tour_count>1) & (df.tour_num == 1) & (df.tour_type.shift(-1) == 'school') & (df.start > df.durationRefBin_school))) * df.durationShift_school",coef_Subsequent_tour_is_school_tour_Duration_gt_8_hours +util_Subsequent_tour_is_work_tour_Duration_lt_8_hours,SCHOOL - Subsequent tour is work tour: Duration < 8 hours,"@(((df.tour_count>1) & (df.tour_num == 1) & (df.subsequent_tour_is_work) & (df.start < df.durationRefBin_school))) * df.durationShift_school",coef_Subsequent_tour_is_work_tour_Duration_lt_8_hours +util_Subsequent_tour_is_work_tour_Duration_gt_8_hours,SCHOOL - Subsequent tour is work tour: Duration > 8 hours,"@(((df.tour_count>1) & (df.tour_num == 1) & (df.subsequent_tour_is_work) & (df.start > df.durationRefBin_school))) * df.durationShift_school",coef_Subsequent_tour_is_work_tour_Duration_gt_8_hours +util_Subsequent_tour_is_school_tour_Departure_after_800_am,SCHOOL - Subsequent tour is school tour: Departure after 8:00 am,"@(((df.tour_count>1) & (df.tour_num == 1) & (df.subsequent_tour_is_school) & (df.start > df.departureRefBin_school))) *df.departureLinearShift1",coef_Subsequent_tour_is_school_tour_Departure_after_800_am +util_Subsequent_tour_is_school_tour_Duration_lt_8_hours,SCHOOL - Subsequent tour is school tour: Duration < 8 hours,"@(((df.tour_count>1) & (df.tour_num == 1) & (df.subsequent_tour_is_school) & (df.start < df.durationRefBin_school))) * df.durationShift_school",coef_Subsequent_tour_is_school_tour_Duration_lt_8_hours +util_Subsequent_tour_is_school_tour_Duration_gt_8_hours,SCHOOL - Subsequent tour is school tour: Duration > 8 hours,"@(((df.tour_count>1) & (df.tour_num == 1) & (df.subsequent_tour_is_school) & (df.start > df.durationRefBin_school))) * df.durationShift_school",coef_Subsequent_tour_is_school_tour_Duration_gt_8_hours util_Second_tour_of_two_mandatory_tours_Duration_lt_4_hours,SCHOOL - Second tour of two mandatory tours: Duration < 4 hours,"@(((df.tour_count>1) & (df.tour_num > 1)) & (df.duration<7)) * (((7-df.duration)*(df.duration<=7)) + ((df.duration-7)*(df.duration>7)))",coef_Second_tour_of_two_mandatory_tours_Duration_lt_4_hours util_Second_tour_of_two_mandatory_tours_Duration_gt_4_hours,SCHOOL - Second tour of two mandatory tours: Duration > 4 hours,"@(((df.tour_count>1) & (df.tour_num > 1)) & (df.duration>7)) * (((7-df.duration)*(df.duration<=7)) + ((df.duration-7)*(df.duration>7)))",coef_Second_tour_of_two_mandatory_tours_Duration_gt_4_hours util_Departure_Constant_Before_0600_AM,SCHOOL - Departure Constant: Before 06:00 AM,@(df.start<7),coef_Departure_Constant_Before_0600_AM diff --git a/test/test_sandag_abm3.py b/test/test_sandag_abm3.py index 4d8a612..f04ab40 100644 --- a/test/test_sandag_abm3.py +++ b/test/test_sandag_abm3.py @@ -210,7 +210,7 @@ def test_sandag_abm3_sharrow(): def test_sandag_abm3_progressive(use_sharrow): import activitysim.abm # register components # noqa: F401 - out_dir = _test_path("output-progressive") + out_dir = _test_path("output-progressive-sharrow" if use_sharrow else "output-progressive") out_dir.mkdir(exist_ok=True) out_dir.joinpath(".gitignore").write_text("**\n")