Skip to content

Commit 9ad1d0d

Browse files
committed
enabling compute settings for trip scheduling choice
1 parent 28fdbb6 commit 9ad1d0d

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

activitysim/abm/models/trip_scheduling_choice.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
get_time_windows,
1414
)
1515
from activitysim.core import chunk, expressions, simulate, tracing, workflow
16-
from activitysim.core.configuration.base import PreprocessorSettings, PydanticReadable
16+
from activitysim.core.configuration.base import (
17+
ComputeSettings,
18+
PreprocessorSettings,
19+
PydanticReadable,
20+
)
1721
from activitysim.core.interaction_sample_simulate import _interaction_sample_simulate
1822
from activitysim.core.skim_dataset import SkimDataset
1923
from activitysim.core.skim_dictionary import SkimDict
@@ -223,6 +227,7 @@ def run_trip_scheduling_choice(
223227
skims,
224228
locals_dict: Mapping,
225229
trace_label: str,
230+
model_settings: TripSchedulingChoiceSettings,
226231
):
227232
NUM_TOUR_LEGS = 3
228233
trace_label = tracing.extend_trace_label(trace_label, "interaction_sample_simulate")
@@ -296,6 +301,7 @@ def run_trip_scheduling_choice(
296301
trace_choice_name="trip_schedule_stage_1",
297302
estimator=None,
298303
chunk_sizer=chunk_sizer,
304+
compute_settings=model_settings.compute_settings,
299305
)
300306

301307
assert len(choices.index) == len(choosers.index)
@@ -338,6 +344,9 @@ class TripSchedulingChoiceSettings(PydanticReadable, extra="forbid"):
338344
SPECIFICATION: str
339345
"""file name of specification file"""
340346

347+
compute_settings: ComputeSettings = ComputeSettings()
348+
"""Compute settings for this component."""
349+
341350

342351
@workflow.step
343352
def trip_scheduling_choice(
@@ -419,7 +428,13 @@ def trip_scheduling_choice(
419428
)
420429

421430
tours_df = run_trip_scheduling_choice(
422-
state, spec, tours_df, skims, locals_dict, trace_label
431+
state,
432+
spec,
433+
tours_df,
434+
skims,
435+
locals_dict,
436+
trace_label,
437+
model_settings,
423438
)
424439

425440
state.add_table("tours", tours_df)

activitysim/core/interaction_sample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def _interaction_sample(
266266
locals_d,
267267
custom_chooser=None,
268268
sharrow_enabled=sharrow_enabled,
269-
additional_columns=compute_settings.protect_columns,
269+
additional_columns=["tdd"] + compute_settings.protect_columns,
270270
)
271271

272272
if sharrow_enabled:

activitysim/core/interaction_sample_simulate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def _interaction_sample_simulate(
167167
locals_d,
168168
custom_chooser=None,
169169
sharrow_enabled=sharrow_enabled,
170-
additional_columns=compute_settings.protect_columns,
170+
additional_columns=["tdd"] + compute_settings.protect_columns,
171171
)
172172

173173
interaction_df = alternatives.join(choosers, how="left", rsuffix="_chooser")

0 commit comments

Comments
 (0)