forked from ActivitySim/sandag-abm3-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Description,Target,Expression | ||
micro access time at taz,taz_microAccTime,"land_use.sort_values(by='MicroAccessTime',ascending=False).drop_duplicates('TAZ',keep='first').set_index('TAZ')['MicroAccessTime'].reindex(df.index)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
annotate_tables: | ||
- tablename: land_use_taz | ||
annotate: | ||
SPEC: annotate_landuse_taz | ||
DF: land_use_taz | ||
TABLES: | ||
- land_use |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from __future__ import annotations | ||
|
||
import logging | ||
|
||
from activitysim.core import chunk, workflow | ||
from activitysim.abm.models.initialize import InitializeTableSettings, annotate_tables | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
@workflow.step | ||
def initialize_landuse_taz( | ||
state: workflow.State, | ||
model_settings: InitializeTableSettings | None = None, | ||
model_settings_file_name: str = "initialize_landuse_taz.yaml", | ||
trace_label: str = "initialize_landuse_taz", | ||
) -> None: | ||
""" | ||
Initialize the land use table. | ||
Parameters | ||
---------- | ||
state : State | ||
""" | ||
if model_settings is None: | ||
model_settings = InitializeTableSettings.read_settings_file( | ||
state.filesystem, | ||
model_settings_file_name, | ||
mandatory=True, | ||
) | ||
with chunk.chunk_log(state, trace_label, base=True) as chunk_sizer: | ||
annotate_tables(state, model_settings, trace_label, chunk_sizer) |