Disease Observer

This module contains tools for observing disease incidence and prevalence in the simulation.

class vivarium_public_health.metrics.disease.DiseaseObserver(disease)[source]

Observes disease counts and person time for a cause.

By default, this observer computes aggregate disease state person time and counts of disease events over the full course of the simulation. It can be configured to add or remove stratification groups to the default groups defined by a ResultsStratifier.

In the model specification, your configuration for this component should be specified as, e.g.:

configuration:
    stratification:
        cause_name:
            exclude:
                - "sex"
            include:
                - "sample_stratification"
Parameters:

disease (str) –

CONFIGURATION_DEFAULTS: Dict[str, Any] = {'stratification': {'disease': {'exclude': [], 'include': []}}}

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

property configuration_defaults: Dict[str, Any]

Provides a dictionary containing the defaults for any configurations managed by this component.

These default values will be stored at the component_configs layer of the simulation’s ConfigTree.

Returns:

A dictionary containing the defaults for any configurations managed by this component.

Return type:

Dict[str, Any]

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]]

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

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

on_time_step_prepare(event)[source]

Method that vivarium will run during the time_step__prepare event.

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

Parameters:

event (Event) – The event object associated with the time_step__prepare event.

Return type:

None

aggregate_state_person_time(x)[source]
Parameters:

x (DataFrame) –

Return type:

float