State#

class activitysim.core.workflow.State(context=None)#

The encapsulated state of an ActivitySim model.

Methods

__init__([context])

Initialize the encapsulated state of an ActivitySim model.

access(key[, initializer])

Raw access to values stored in this state's context.

add_injectable(key, value)

Alias for State.set().

add_table(name, content[, salient])

Add a data table to this context, and potentially mark it for checkpointing.

close_on_exit(file, name)

close_open_files()

close_pipeline()

Close any known open files

copy()

Create a copy of this State.

default_settings([force])

Initialize with all default settings, rather than reading from a file.

drop(key)

Remove a key from the context.

drop_table(table_name)

extend_table(table_name, df[, axis])

add new table or extend (add rows) to an existing table

extract(func)

get(key[, default])

Automated access to values stored in this state's context.

get_dataarray(tablename, item[, as_copy])

Get a workflow table item as a xarray.DataArray.

get_dataframe(tablename[, columns, as_copy])

Get a workflow table as a pandas.DataFrame.

get_dataframe_index_name(tablename)

Get the index name for a workflow table.

get_dataset(table_name[, column_names, as_copy])

Get a workflow table or dataset as a xarray.Dataset.

get_global_constants()

Read global constants from settings file

get_injectable(key[, default])

Alias for State.get().

get_log_file_path(file_name[, prefix])

Get the log file path for this process.

get_output_file_path(file_name[, prefix])

get_pyarrow(tablename[, columns])

Get a workflow table as a pyarrow.Table.

get_rn_generator()

Return the singleton random number object

get_step_arg(arg_name[, default])

get_table(table_name[, checkpoint_name])

Return pandas dataframe corresponding to table_name

import_extensions([ext, append])

Import one or more extension modules for use with this model.

init_state()

Initialize this state.

initialize_filesystem([working_dir, ...])

Initialize the state's filesystem.

is_table(name)

Check if a name corresponds to a table in this state's context.

load_settings()

Read and parse settings file(s) from config dirs.

make_default([working_dir, settings])

Convenience constructor for mostly default States.

make_temp([source, checkpoint_name])

Initialize state with a temporary directory.

pipeline_table_key(table_name, checkpoint_name)

registered_tables()

Return a list of the names of all currently registered dataframe tables

rng()

set(key, value)

Set a new value for a key in the context.

set_step_args([args])

should_save_checkpoint([checkpoint_name])

trace_memory_info(event[, trace_ticks])

uncheckpointed_table_names()

Attributes

checkpoint

State accessor for checkpointing operations.

chunk

This accessor provides chunking tools.

current_model_name

Name of the currently running model.

dataset

This accessor provides easy access to state tables and datasets.

existing_table_names

existing_table_status

extend

Methods to extend the capabilities of ActivitySim.

filesystem

Manage finding and loading files for ActivitySim's command line interface.

known_table_names

logging

This accessor provides logging tools.

network_settings

Network level of service and skims settings

report

Tools for reporting and visualization

run

This accessor provides the tools to actually run ActivitySim workflow steps.

settings

The overall settings for the ActivitySim model system.

this_step

tracing

Methods to provide the tracing capabilities of ActivitySim.

open_files

Files to close when state is destroyed or re-initialized.