Skip to content

Commit

Permalink
Merge pull request #813 from camsys/no-cats-escort-participant
Browse files Browse the repository at this point in the history
No categories for escort participants
  • Loading branch information
jpn-- authored Feb 26, 2024
2 parents ff3e96b + 525fd7c commit 7d65293
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions activitysim/abm/models/util/school_escort_tours_trips.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,10 @@ def merge_school_escort_trips_into_pipeline(state: workflow.State):

# converting to categoricals
trips["school_escort_direction"] = trips["school_escort_direction"].astype(
"category"
pd.api.types.CategoricalDtype(["outbound", "inbound"], ordered=False)
)
trips["escort_participants"] = trips["escort_participants"].astype("category")
# trips["escort_participants"] is left with dtype of object (i.e. Python strings)
# as it doesn't have a fixed number of categories

# updating trip_id now that we have all trips
trips = canonical_ids.set_trip_index(state, trips)
Expand Down

0 comments on commit 7d65293

Please sign in to comment.