Skip to content

Commit

Permalink
Merge pull request #274 from SANDAG/escort_participants_string
Browse files Browse the repository at this point in the history
Force AV allocation to read escort_participants as string
  • Loading branch information
bhargavasana authored Dec 6, 2024
2 parents ac77fbc + 7bcb894 commit 2f5c0f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -483,3 +483,5 @@ Description,Target,Expression
,origin_purpose,"np.where(trips.trip_count == 1 & (trips.primary_purpose == 'atwork'), 'work', origin_purpose)"
,origin_purpose,"np.where((trips.trip_count > 1) & (trips.trip_num==1) & (trips.outbound), 'home', origin_purpose)"
,origin_purpose,"np.where(((trips.trip_count > 1) & (trips.trip_num>1)) | ((trips.trip_count > 1) & (trips.trip_num==1) & ~(trips.outbound)), trips['purpose'].shift(1), origin_purpose)"
#AV allocation model needs column to be entirely in string format,,
,escort_participants,"np.where(trips.escort_participants.isna() | trips.escort_participants == '',trips.escort_participants,'_'+trips.escort_participants)"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
def get_escort_participant_list(escort_participants):
if type(escort_participants) == str:
return [int(participant) for participant in escort_participants.split('_')]
return [int(participant) for participant in escort_participants.split('_')[1:]]
else:
return []

Expand Down

0 comments on commit 2f5c0f8

Please sign in to comment.