3030)
3131from activitysim .core .configuration .base import PreprocessorSettings
3232from activitysim .core .configuration .logit import LocationComponentSettings
33+ from activitysim .core .exceptions import DuplicateWorkflowTableError , InvalidTravelError
3334from activitysim .core .interaction_sample import interaction_sample
3435from activitysim .core .interaction_sample_simulate import interaction_sample_simulate
3536from activitysim .core .skim_dictionary import DataFrameMatrix
3637from activitysim .core .tracing import print_elapsed_time
3738from activitysim .core .util import assign_in_place , reindex
38- from activitysim .core .exceptions import InvalidTravelError , DuplicateWorkflowTableError
3939
4040logger = logging .getLogger (__name__ )
4141
@@ -280,7 +280,9 @@ def aggregate_size_term_matrix(maz_size_term_matrix, network_los, all_tazs=None)
280280 dest_taz = network_los .map_maz_to_taz (df .index )
281281 taz_size_term_matrix = df .groupby (dest_taz ).sum ()
282282 if all_tazs is not None :
283- taz_size_term_matrix = taz_size_term_matrix .reindex (all_tazs , fill_value = 0 ).rename_axis (taz_size_term_matrix .index .name , axis = 0 )
283+ taz_size_term_matrix = taz_size_term_matrix .reindex (
284+ all_tazs , fill_value = 0
285+ ).rename_axis (taz_size_term_matrix .index .name , axis = 0 )
284286
285287 taz_size_term_matrix = DataFrameMatrix (taz_size_term_matrix )
286288
@@ -621,7 +623,9 @@ def destination_presample(
621623 else :
622624 all_tazs = None
623625
624- TAZ_size_term_matrix = aggregate_size_term_matrix (size_term_matrix , network_los , all_tazs )
626+ TAZ_size_term_matrix = aggregate_size_term_matrix (
627+ size_term_matrix , network_los , all_tazs
628+ )
625629
626630 TRIP_ORIGIN = model_settings .TRIP_ORIGIN
627631 PRIMARY_DEST = model_settings .PRIMARY_DEST
@@ -643,7 +647,9 @@ def destination_presample(
643647 # as a vector which will need to align with the TAZ skims.
644648 if state .settings .sharrow :
645649 all_tazs = state .get_dataframe ("land_use_taz" ).index
646- alternatives = alternatives .reindex (all_tazs , fill_value = 0 ).rename_axis (alternatives .index .name , axis = 0 )
650+ alternatives = alternatives .reindex (all_tazs , fill_value = 0 ).rename_axis (
651+ alternatives .index .name , axis = 0
652+ )
647653
648654 # # i did this but after changing alt_dest_col_name to 'trip_dest' it
649655 # # shouldn't be needed anymore
@@ -1538,13 +1544,13 @@ def run_trip_destination(
15381544 """
15391545
15401546 When using the trip destination model with sharrow, it is necessary
1541- to set a value for `purpose_index_num` in the trip destination
1542- annotate trips preprocessor. This allows for an optimized compiled
1547+ to set a value for `purpose_index_num` in the trip destination
1548+ annotate trips preprocessor. This allows for an optimized compiled
15431549 lookup of the size term from the array of size terms. The value of
1544- `purpose_index_num` should be the integer column position in the size
1545- matrix, with usual zero-based numpy indexing semantics (i.e. the first
1550+ `purpose_index_num` should be the integer column position in the size
1551+ matrix, with usual zero-based numpy indexing semantics (i.e. the first
15461552 column is zero). The preprocessor expression most likely needs to be
1547- "size_terms.get_cols(df.purpose)" unless some unusual transform of
1553+ "size_terms.get_cols(df.purpose)" unless some unusual transform of
15481554 size terms has been employed.
15491555
15501556 """
0 commit comments