cached_object#

class activitysim.core.workflow.cached_object(wrapped_func=None, *, step_name=None)#

Bases: step

Decorator for functions that deliver objects that should be cached.

The function is called to initialize or otherwise generate the value of an object to be cached, but only if the matching name is not already stored in the state’s context.

@workflow.cached_object is equivalent to @workflow.step(cache=True, kind="cached_object").