Interface

Access to vivarium simulation input data.

vivarium_inputs.interface.get_measure(entity, measure, location)[source]

Pull GBD data for measure and entity and prep for simulation input, including scrubbing all GBD conventions to replace IDs with meaningful values or ranges and expanding over all demographic dimensions. To pull data using this function, please have at least 50GB of memory available.

Available measures:

For entity kind ‘sequela’:

incidence_rate, prevalence, birth_prevalence, disability_weight

For entity kind ‘cause’:

incidence_rate, prevalence, birth_prevalence, disability_weight, remission_rate, cause_specific_mortality_rate, excess_mortality_rate

For entity kind ‘risk_factor’:

exposure, exposure_standard_deviation, exposure_distribution_weights, relative_risk, population_attributable_fraction, mediation_factors

For entity kind ‘etiology’:

population_attributable_fraction

For entity kind ‘alternative_risk_factor’:

exposure, exposure_standard_deviation, exposure_distribution_weights

For entity kind ‘covariate’:

estimate

Parameters:
  • entity (ModelableEntity) – Entity for which to pull measure.

  • measure (str) – Measure for which to pull data, should be a measure available for the kind of entity which entity is.

  • location (str) – Location for which to pull data.

Returns:

Dataframe standardized to the format expected by vivarium simulations.

Return type:

pandas.DataFrame

vivarium_inputs.interface.get_population_structure(location)[source]

Pull GBD population data for the given location and standardize to the expected simulation input format, including scrubbing all GBD conventions to replace IDs with meaningful values or ranges and expanding over all demographic dimensions.

Parameters:

location (str) – Location for which to pull population data.

Returns:

Dataframe of population data for location, standardized to the format expected by vivarium simulations.

Return type:

pandas.DataFrame

vivarium_inputs.interface.get_theoretical_minimum_risk_life_expectancy()[source]

Pull GBD theoretical minimum risk life expectancy data and standardize to the expected simulation input format, including binning age parameters as expected by simulations.

Returns:

Dataframe of theoretical minimum risk life expectancy data, standardized to the format expected by vivarium simulations with binned age parameters.

Return type:

pandas.DataFrame

vivarium_inputs.interface.get_age_bins()[source]

Pull GBD age bin data and standardize to the expected simulation input format.

Returns:

Dataframe of age bin data, with bin start and end values as well as bin names.

Return type:

pandas.DataFrame

vivarium_inputs.interface.get_demographic_dimensions(location)[source]

Pull the full demographic dimensions for GBD data, standardized to the expected simulation input format, including scrubbing all GBD conventions to replace IDs with with meaningful values or ranges.

Parameters:

location (str) – Location for which to pull demographic dimension data.

Returns:

Dataframe with age and year bins from GBD, sexes, and the given location.

Return type:

pandas.DataFrame

vivarium_inputs.interface.get_raw_data(entity, measure, location)[source]

Pull raw data from GBD for the requested entity, measure, and location. Skip standard raw validation checks in order to return data that can be investigated for oddities. The only filter that occurs is by applicable measure id, metric id, or to most detailed causes where relevant.

Available measures:

For entity kind ‘sequela’:

incidence_rate, prevalence, birth_prevalence, disability_weight

For entity kind ‘cause’:

incidence_rate, prevalence, birth_prevalence, disability_weight, remission_rate, deaths

For entity kind ‘risk_factor’:

exposure, exposure_standard_deviation, exposure_distribution_weights, relative_risk, population_attributable_fraction, mediation_factors

For entity kind ‘etiology’:

population_attributable_fraction

For entity kind ‘alternative_risk_factor’:

exposure, exposure_standard_deviation, exposure_distribution_weights

For entity kind ‘covariate’:

estimate

For entity kind ‘population’:

structure, theoretical_minimum_risk_life_expectancy

Parameters:
  • entity (ModelableEntity) – Entity for which to extract data.

  • measure (str) – Measure for which to extract data.

  • location (str) – Location for which to extract data.

Returns:

Data for the entity-measure pair and specific location requested, with no formatting or reshaping.

Return type:

Union[pandas.Series, pandas.DataFrame]