Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explicit chunking for interaction-simulate components #804

Merged
merged 3 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion activitysim/abm/models/joint_tour_frequency_composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ def joint_tour_frequency_composition(
alternatives=alt_tdd,
spec=model_spec,
locals_d=constants,
chunk_size=state.settings.chunk_size,
trace_label=trace_label,
trace_choice_name=trace_label,
estimator=estimator,
explicit_chunk_size=0,
)

if estimator:
Expand Down
5 changes: 4 additions & 1 deletion activitysim/abm/models/non_mandatory_tour_frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ class NonMandatoryTourFrequencySettings(LogitComponentSettings):
annotate_tours: PreprocessorSettings | None = None
"""Preprocessor settings to annotate tours"""

explicit_chunk: int = 0
"""Number of rows to process in each chunk when explicit chunking is enabled"""


@workflow.step
def non_mandatory_tour_frequency(
Expand Down Expand Up @@ -305,10 +308,10 @@ def non_mandatory_tour_frequency(
spec=segment_spec,
log_alt_losers=log_alt_losers,
locals_d=constants,
chunk_size=state.settings.chunk_size,
trace_label="non_mandatory_tour_frequency.%s" % segment_name,
trace_choice_name="non_mandatory_tour_frequency",
estimator=estimator,
explicit_chunk_size=model_settings.explicit_chunk,
)

if estimator:
Expand Down
5 changes: 4 additions & 1 deletion activitysim/abm/models/school_escorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,9 @@ class SchoolEscortSettings(BaseLogitComponentSettings):
preprocessor_inbound: PreprocessorSettings | None = None
preprocessor_outbound_cond: PreprocessorSettings | None = None

explicit_chunk: int = 0
"""If > 0, use this chunk size instead of adaptive chunking."""


@workflow.step
def school_escorting(
Expand Down Expand Up @@ -539,10 +542,10 @@ def school_escorting(
spec=model_spec,
log_alt_losers=log_alt_losers,
locals_d=locals_dict,
chunk_size=state.settings.chunk_size,
trace_label=stage_trace_label,
trace_choice_name="school_escorting_" + "stage",
estimator=estimator,
explicit_chunk_size=model_settings.explicit_chunk,
)

if estimator:
Expand Down
5 changes: 4 additions & 1 deletion activitysim/abm/models/vehicle_type_choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,10 @@ def iterate_vehicle_type_choice(
spec=model_spec,
log_alt_losers=log_alt_losers,
locals_d=locals_dict,
chunk_size=chunk_size,
trace_label=trace_label,
trace_choice_name="vehicle_type",
estimator=estimator,
explicit_chunk_size=model_settings.explicit_chunk,
)

# otherwise, "simple simulation" should suffice, with a model spec that enumerates
Expand Down Expand Up @@ -556,6 +556,9 @@ class VehicleTypeChoiceSettings(LogitComponentSettings):

FLEET_YEAR: int

explicit_chunk: int = 0
"""If > 0, use this chunk size instead of adaptive chunking."""


@workflow.step
def vehicle_type_choice(
Expand Down
291 changes: 0 additions & 291 deletions activitysim/core/configuration.py

This file was deleted.

Loading
Loading