Results Stratifier

This module contains tools for stratifying observed quantities by specified characteristics through the vivarium results interface.

class vivarium_public_health.metrics.stratification.ResultsStratifier[source]
setup(builder)[source]

Defines custom actions this component 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 component. By default, it does nothing.

Parameters:

builder (Builder) – The builder object used to set up the component.

Return type:

None

register_stratifications(builder)[source]
Parameters:

builder (Builder) –

Return type:

None

map_age_groups(pop)[source]

Map age with age group name strings

Parameters:

pop (DataFrame) – A DataFrame with one column, an age to be mapped to an age group name string

Returns:

A pd.Series with age group name string corresponding to the pop passed into the function

Return type:

pandas.Series

static map_year(pop)[source]

Map datetime with year

Parameters:

pop (DataFrame) – A DataFrame with one column, a datetime to be mapped to year

Returns:

A pd.Series with years corresponding to the pop passed into the function

Return type:

pandas.Series

static get_age_bins(builder)[source]
Parameters:

builder (Builder) –

Return type:

DataFrame