Lookup Table Manager
Simulations tend to require a large quantity of data to run. vivarium
provides the Lookup Table
abstraction to ensure that accurate data can be retrieved when it’s needed. It’s
a callable object that takes in a population index and returns data specific to
the individuals represented by that index. See the
lookup concept note for more.
- class vivarium.framework.lookup.manager.LookupTableManager[source]
Manages complex data in the simulation.
Notes
Client code should never access this class directly. Use
lookupon the builder during setup to get references to LookupTable objects.- CONFIGURATION_DEFAULTS: dict[str, Any] = {'interpolation': {'extrapolate': True, 'order': 0, 'validate': True}}
A dictionary containing the defaults for any configurations managed by this manager. An empty dictionary indicates no managed configurations.
- setup(builder)[source]
Defines custom actions this manager needs to run during the setup lifecycle phase.
This method is intended to be overridden by subclasses to perform any necessary setup operations specific to the manager. By default, it does nothing.
- build_table(data, name, value_columns)[source]
Construct a lookup table from input data.
- Parameters:
- Return type:
LookupTable[pd.Series[Any]] | LookupTable[pd.DataFrame]