Artifact Manager

This module contains the ArtifactManager, a vivarium plugin for handling complex data bound up in a data artifact.

class vivarium.engine.framework.artifact.manager.ArtifactManager[source]

The controller plugin component for managing a data artifact.

CONFIGURATION_DEFAULTS: dict[str, Any] = {'input_data': {'artifact_filter_term': None, 'artifact_path': None, 'input_draw_number': None}}

A dictionary containing the defaults for any configurations managed by this manager. An empty dictionary indicates no managed configurations.

property name: str
setup(builder)[source]

Performs this component’s simulation setup.

Return type:

None

Parameters:

builder (Builder)

load(entity_key, **column_filters)[source]

Loads data associated with the given entity key.

Return type:

Any

Parameters:
  • entity_key (str) – The key associated with the expected data.

  • column_filters (int | str | Sequence[int | str]) – Filters that subset the data by a categorical column and then remove the column from the raw data. They are supplied as keyword arguments to the load method in the form “column=value”.

Returns:

The data associated with the given key, filtered down to the requested subset if the data is a dataframe.

vivarium.engine.framework.artifact.manager.filter_data(data, config_filter_term=None, **column_filters)[source]

Uses the provided column filters and age_group conditions to subset the raw data.

Return type:

DataFrame

Parameters:
vivarium.engine.framework.artifact.manager.validate_filter_term(config_filter_term)[source]
Return type:

str | None

Parameters:

config_filter_term (str | None)

vivarium.engine.framework.artifact.manager.get_base_filter_terms(configuration)[source]

Parses default filter terms from the artifact configuration.

Return type:

list[str]

Parameters:

configuration (ConfigTree)

vivarium.engine.framework.artifact.manager.parse_artifact_path_config(config)[source]

Gets the path to the data artifact from the simulation configuration.

The path specified in the configuration may be absolute or it may be relative to the location of the configuration file.

Return type:

str

Parameters:

config (ConfigTree) – The configuration block of the simulation model specification containing the artifact path.

Returns:

The path to the data artifact.