Skip to content

Commit

Permalink
tracing for disaggregate accessibilities
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensle committed Dec 16, 2023
1 parent a8e755f commit 325158b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions activitysim/core/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,18 +776,27 @@ def interaction_trace_rows(interaction_df, choosers, sample_size=None):
households_table_name.pop(),
)

if choosers.index.name == "person_id" and persons_table_name in traceable_table_ids:
if (
choosers.index.name in ["person_id", "proto_person_id"]
) and persons_table_name in traceable_table_ids:
slicer_column_name = choosers.index.name
targets = traceable_table_ids["persons"]
elif choosers.index.name == "household_id" and "households" in traceable_table_ids:
targets = traceable_table_ids[persons_table_name]
elif (
choosers.index.name in ["household_id", "proto_household_id"]
) and households_table_name in traceable_table_ids:
slicer_column_name = choosers.index.name
targets = traceable_table_ids["households"]
targets = traceable_table_ids[households_table_name]
elif "household_id" in choosers.columns and "households" in traceable_table_ids:
slicer_column_name = "household_id"
targets = traceable_table_ids[households_table_name]
elif "person_id" in choosers.columns and persons_table_name in traceable_table_ids:
slicer_column_name = "person_id"
targets = traceable_table_ids[persons_table_name]
elif (
choosers.index.name == "proto_tour_id" and "proto_tours" in traceable_table_ids
):
slicer_column_name = choosers.index.name
targets = traceable_table_ids["proto_tours"]
else:
print(choosers.columns)
raise RuntimeError(
Expand Down

0 comments on commit 325158b

Please sign in to comment.