File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -107,8 +107,11 @@ def tour_od_choice(
107107 estimator .write_override_choices (choices_df .choice )
108108 estimator .end_estimation ()
109109
110- tours [origin_col_name ] = choices_df [origin_col_name ]
111- tours [dest_col_name ] = choices_df [dest_col_name ]
110+ tours [origin_col_name ] = choices_df [origin_col_name ].reindex (tours .index )
111+ tours [dest_col_name ] = choices_df [dest_col_name ].reindex (tours .index )
112+ if want_logsums :
113+ tours [logsum_column_name ] = \
114+ choices_df ['logsum' ].reindex (tours .index ).astype ('float' )
112115 tours ['poe_id' ] = tours [origin_col_name ].map (land_use .to_frame (columns = 'poe_id' ).poe_id )
113116
114117 households = households .to_frame ()
Original file line number Diff line number Diff line change @@ -752,6 +752,10 @@ def run_od_logsums(
752752 pipeline .get_rn_generator ().drop_channel ('trips' )
753753 tracing .deregister_traceable_table ('trips' )
754754
755+ assert (od_sample .index == choosers .index ).all ()
756+ for col in new_cols :
757+ od_sample [col ] = choosers [col ]
758+
755759 logsums = logsum .compute_logsums (
756760 choosers ,
757761 spec_segment_name ,
@@ -762,6 +766,7 @@ def run_od_logsums(
762766 chunk_tag ,
763767 trace_label , 'end' , 'start' , 'duration' )
764768
769+ assert (od_sample .index == logsums .index ).all ()
765770 od_sample ['tour_mode_choice_logsum' ] = logsums
766771
767772 return od_sample
You can’t perform that action at this time.
0 commit comments