Low Birth Weight and Short Gestation

Low birth weight and short gestation (LBWSG) is a non-standard risk implementation that has been used in several public health models.

class vivarium_public_health.risks.implementations.low_birth_weight_and_short_gestation.LBWSGDistribution(exposure_data=None)[source]
Parameters:

exposure_data (DataFrame) –

CONFIGURATION_DEFAULTS: Dict[str, Any] = {'lbwsg_distribution': {'age_column': 'age', 'sex_column': 'sex', 'year_column': 'year'}}

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

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

get_exposure_data(builder)[source]
Parameters:

builder (Builder) –

Return type:

DataFrame

get_exposure_parameters(builder)[source]
Parameters:

builder (Builder) –

Return type:

Pipeline

get_category_intervals(builder)[source]

Gets the intervals for each category. It is a dictionary from the string “birth_weight” or “gestational_age” to a dictionary from the category name to the interval :param builder: :return:

Parameters:

builder (Builder) –

Return type:

Dict[str, Dict[str, Interval]]

ppf(propensities)[source]

Takes a DataFrame with three columns: ‘categorical.propensity’, ‘birth_weight.propensity’, and ‘gestational_age.propensity’ which contain each of those propensities for each simulant.

Returns a DataFrame with two columns for birth-weight and gestational age exposures.

Parameters:

propensities (DataFrame) –

Returns:

Return type:

DataFrame

single_axis_ppf(axis, propensity, categorical_propensity=None, categorical_exposure=None)[source]

Takes an axis (either ‘birth_weight’ or ‘gestational_age’), a propensity and either a categorical propensity or a categorical exposure and returns continuous exposures for that axis.

If categorical propensity is provided rather than exposure, this function requires access to the low birth weight and short gestation categorical exposure parameters pipeline (“risk_factor.low_birth_weight_and_short_gestation.exposure_parameters”).

Parameters:
  • axis (str) –

  • propensity (Series) –

  • categorical_propensity (Series) –

  • categorical_exposure (Series) –

Returns:

Return type:

Series

class vivarium_public_health.risks.implementations.low_birth_weight_and_short_gestation.LBWSGRisk[source]
AXES = ['birth_weight', 'gestational_age']
static birth_exposure_pipeline_name(axis)[source]
Parameters:

axis (str) –

Return type:

str

static exposure_column_name(axis)[source]
Parameters:

axis (str) –

Return type:

str

property columns_created: List[str]

Provides names of columns created by the component.

Returns:

Names of the columns created by this component, or an empty list if none.

Return type:

List[str]

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

get_exposure_distribution()[source]
Return type:

LBWSGDistribution

get_propensity_pipeline(builder)[source]
Parameters:

builder (Builder) –

Return type:

Pipeline | None

get_exposure_pipeline(builder)[source]
Parameters:

builder (Builder) –

Return type:

Pipeline | None

get_birth_exposure_pipelines(builder)[source]
Parameters:

builder (Builder) –

Return type:

Dict[str, Pipeline]

on_initialize_simulants(pop_data)[source]

Method that vivarium will run during simulant initialization.

This method is intended to be overridden by subclasses if there are operations they need to perform specifically during the simulant initialization phase.

Parameters:

pop_data (SimulantData) – The data associated with the simulants being initialized.

Return type:

None

get_birth_exposure(axis, index)[source]
Parameters:
Return type:

DataFrame

get_current_exposure(index)[source]
Parameters:

index (Index) –

Return type:

DataFrame

class vivarium_public_health.risks.implementations.low_birth_weight_and_short_gestation.LBWSGRiskEffect(target)[source]
Parameters:

target (str) –

TMREL_BIRTH_WEIGHT_INTERVAL: Interval = Interval(3500.0, 4500.0, closed='right')
TMREL_GESTATIONAL_AGE_INTERVAL: Interval = Interval(38.0, 42.0, closed='right')
property columns_created: List[str]

Provides names of columns created by the component.

Returns:

Names of the columns created by this component, or an empty list if none.

Return type:

List[str]

property columns_required: List[str] | None

Provides names of columns required by the component.

Returns:

Names of required columns not created by this component. An empty list means all available columns are needed. None means no additional columns are necessary.

Return type:

Optional[List[str]]

property initialization_requirements: Dict[str, List[str]]

Provides the names of all values required by this component during simulant initialization.

Returns:

A dictionary containing the additional requirements of this component during simulant initialization. An omitted key or an empty list for a key implies no requirements for that key during initialization.

Return type:

Dict[str, List[str]]

relative_risk_column_name(age_group_id)[source]
Return type:

str

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

get_risk_exposure(builder)[source]
Parameters:

builder (Builder) –

Return type:

Callable[[Index], DataFrame]

get_target_modifier(builder)[source]
Parameters:

builder (Builder) –

Return type:

Callable[[Index, Series], Series]

register_target_modifier(builder)[source]
Parameters:

builder (Builder) –

Return type:

None

get_age_intervals(builder)[source]
Parameters:

builder (Builder) –

Return type:

Dict[str, Interval]

get_rr_column_names()[source]
Return type:

List[str]

get_relative_risk_source(builder)[source]

Get the relative risk source for this risk effect model.

Parameters:

builder (Builder) – Interface to access simulation managers.

Returns:

A lookup table containing the relative risk data for this risk effect model.

Return type:

LookupTable

get_population_attributable_fraction_source(builder)[source]

Get the population attributable fraction source for this risk effect model.

Parameters:

builder (Builder) – Interface to access simulation managers.

Returns:

A lookup table containing the population attributable fraction data for this risk effect model.

Return type:

LookupTable

get_interpolator(builder)[source]
Parameters:

builder (Builder) –

Return type:

Series

on_initialize_simulants(pop_data)[source]

Method that vivarium will run during simulant initialization.

This method is intended to be overridden by subclasses if there are operations they need to perform specifically during the simulant initialization phase.

Parameters:

pop_data (SimulantData) – The data associated with the simulants being initialized.

Return type:

None

get_relative_risk(index)[source]
Parameters:

index (Index) –

Return type:

Series