emod_api.interventions.utils module#
- emod_api.interventions.utils.do_nodes(schema_path, node_ids: list | None = None)[source]#
Create and return a NodeSetConfig based on node_ids list.
- Parameters:
schema_path – Path to schema.json file.
node_ids – a list of NodeIDs, defaults to None, which is NodeSetAll
- Returns:
Well-configured NodeSetConfig
- emod_api.interventions.utils.get_waning_from_params(schema_path, initial=1.0, box_duration=365, decay_rate=0, decay_time_constant=None)[source]#
Get well-configured waning structure. Default is 1-year full efficacy box. Note that an infinite decay rate (0 or even -1) is same as WaningEffectBox. Note that an infinite box duration (-1) is same as WaningEffectConstant. Note that a zero box duration is same as WaningEffectExponential.
- Parameters:
schema_path – Path to schema.json file.
initial – Initial_Effect value, defaults to 1.0.
box_duration – Number of timesteps efficacy remains at Initial_Effect before decay. Defaults to 365.
decay_rate – Rate at which Initial_Effect decays after box_duration. Defaults to 0.
decay_time_constant – 1/decay_rate. Defaults to None. Use this or decay_rate, not both. If this is specified, decay_rate is ignored.
- Returns:
A well-configured WaningEffect structure
Deprecated since version 2.x: Please use function get_waning_from_parameters() or get_waning_from_points().
- emod_api.interventions.utils.get_waning_from_points(schema_path, initial: float = 1.0, times_values=None, expire_at_end: bool = False)[source]#
Get well-configured waning structure.
- Parameters:
schema_path – Path to schema.json file.
initial – Initial_Effect value, defaults to 1.0.
times_values – A list of tuples with days and values. The values match the defined linear values that modify the Initial_Effect, e.g. [(day_0, value_0), (day_5, value_5)].
expire_at_end – Set to 1 to have efficacy go to zero and let the intervention expire when the end of the map is reached. Only vaccines and bednet usage currently support this expiration feature. defaults to 0.
- Returns:
A well-configured WaningEffectMapLinear structure
- emod_api.interventions.utils.get_waning_from_parameters(schema_path, initial: float = 1.0, box_duration: float = 365, decay_rate: float = 0, decay_time_constant: float | None = None)[source]#
Get well-configured waning structure. Default is 1-year full efficacy box. Note that an infinite decay rate (0 or even -1) is same as WaningEffectBox. Note that an infinite box duration (-1) is same as WaningEffectConstant. Note that a zero box duration is same as WaningEffectExponential.
- Parameters:
schema_path – Path to schema.json file.
initial – Initial_Effect value, defaults to 1.0.
box_duration – Number of timesteps efficacy remains at Initial_Effect before decay. Defaults to 365.
decay_rate – Rate at which Initial_Effect decays after box_duration. Defaults to 0.
decay_time_constant – 1/decay_rate. Defaults to None. Use this or decay_rate, not both. If this is specified, decay_rate is ignored.
- Returns:
A well-configured WaningEffect structure