Linear Scale-Up Model

This module contains tools for applying a linear scale-up to an intervention

class vivarium_public_health.treatment.scale_up.LinearScaleUp(treatment)[source]

A model for applying a linear scale-up to an intervention.

This component requires input data for beginning and end dates, as well as beginning and end values. Scale-up start and end dates are by default the beginning and end of the simulation, but they can both be set to other values in the configuration. Data for the values at scale-up endpoints can be sourced either from builder.data or from parameters provided in the configuration. For example, for an intervention called ‘treatment’ the configuration could look like this:

configuration:
    treatment_scale_up:
        start:
            date: "2020-01-01"
            value: 0.0
        end:
            date: "2020-12-31"
            value: 0.9
Parameters:

treatment (str) –

CONFIGURATION_DEFAULTS: Dict[str, Any] = {'treatment': {'date': {'end': '2020-12-31', 'start': '2020-01-01'}, 'value': {'end': 'data', 'start': 'data'}}}

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 configuration_key: str
setup(builder)[source]

Perform this component’s setup.

Parameters:

builder (Builder) –

Return type:

None

get_is_intervention_scenario(builder)[source]
Parameters:

builder (Builder) –

Return type:

bool

get_clock(builder)[source]
Parameters:

builder (Builder) –

Return type:

Callable[[], Timestamp | datetime | Number]

get_scale_up_dates(builder)[source]
Parameters:

builder (Builder) –

Return type:

Tuple[Timestamp, Timestamp]

get_scale_up_values(builder)[source]

Get the values at the start and end of the scale-up period.

Parameters:

builder (Builder) – Interface to access simulation managers.

Returns:

A tuple of lookup tables returning the values at the start and end of the scale-up period.

Return type:

LookupTable

get_required_pipelines(builder)[source]
Parameters:

builder (Builder) –

Return type:

Dict[str, Pipeline]

register_intervention_modifiers(builder)[source]
Parameters:

builder (Builder) –

coverage_effect(idx, target)[source]
Parameters:
Return type:

Series

get_endpoint_value_from_data(builder, endpoint_type)[source]

Get the value at the start or end of the scale-up period from data.

Parameters:
  • builder (Builder) – Interface to access simulation managers.

  • endpoint_type (str) – The type of endpoint to get the value for. Allowed values are “start” and “end”.

Returns:

A lookup table returning the value at the start or end of the scale-up period.

Return type:

LookupTable

apply_scale_up(idx, target, scale_up_progress)[source]
Parameters:
Return type:

Series