fpmod
Defines the FPmod class
Classes
| Name | Description |
|---|---|
| FPmod | Class for storing and updating FP-related events |
FPmod
fpmod.FPmod(pars=None, location=None, data=None, name='fp', **kwargs)Class for storing and updating FP-related events
Methods
| Name | Description |
|---|---|
| check_conception | Decide if person (female) becomes pregnant at a timestep. |
| check_infant_mortality | Check for probability of infant mortality (death < 1 year of age) |
| check_lam | Check to see if postpartum agent meets criteria for |
| check_maternal_mortality | Check for probability of maternal mortality |
| check_sexually_active | Decide if agent is sexually active based either time-on-postpartum month |
| compute_asfr | Computes age-specific fertility rates (ASFR). Since this is calculated each timestep, |
| compute_method_usage | Store number of women using each method |
| init_intent_states | Initialize intent_to_use and fertility_intent states for women aged 15-49 |
| init_results | Initialize result storage. Most default results are either arrays or lists; these are |
| make_pregnant | Update the selected agents to be pregnant. This also sets their method to no contraception |
| process_delivery | Decide if pregnant woman gives birth and explore maternal mortality and child mortality |
| progress_pregnancy | Advance pregnancy in time and check for miscarriage |
| reset_postpartum | Stop breastfeeding and reset durations |
| step | Perform all updates to people within a single timestep |
| update_breastfeeding | Update breastfeeding status, resetting to False for anyone finished |
| update_mortality | Update infant and maternal mortality for the sim’s current year. |
| update_postpartum | Update postpartum status, resetting to False for anyone finished |
| update_time_to_choose | Initialise the counter to determine when girls/women will have to first choose a method. |
check_conception
fpmod.FPmod.check_conception(uids)Decide if person (female) becomes pregnant at a timestep.
check_infant_mortality
fpmod.FPmod.check_infant_mortality(uids)Check for probability of infant mortality (death < 1 year of age) TODO: should this be removed if we are using standard death rates, which already include infant mortality?
check_lam
fpmod.FPmod.check_lam()Check to see if postpartum agent meets criteria for Lactation amenorrhea method (LAM) LAM in this time step
check_maternal_mortality
fpmod.FPmod.check_maternal_mortality(uids)Check for probability of maternal mortality
check_sexually_active
fpmod.FPmod.check_sexually_active(uids=None)Decide if agent is sexually active based either time-on-postpartum month or their age if not postpartum.
Agents can revert to active or not active each timestep. Postpartum and general age-based data from DHS.
compute_asfr
fpmod.FPmod.compute_asfr()Computes age-specific fertility rates (ASFR). Since this is calculated each timestep, the annualized results should compute the sum.
compute_method_usage
fpmod.FPmod.compute_method_usage()Store number of women using each method
init_intent_states
fpmod.FPmod.init_intent_states(uids)Initialize intent_to_use and fertility_intent states for women aged 15-49
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| uids | array of user IDs to initialize | required |
init_results
fpmod.FPmod.init_results()Initialize result storage. Most default results are either arrays or lists; these are all stored in defaults.py. Any other results with different formats can also be added here.
make_pregnant
fpmod.FPmod.make_pregnant(uids)Update the selected agents to be pregnant. This also sets their method to no contraception and determines the length of pregnancy and expected time of delivery.
process_delivery
fpmod.FPmod.process_delivery(uids=None)Decide if pregnant woman gives birth and explore maternal mortality and child mortality Also update states including parity, n_births, n_stillbirths
progress_pregnancy
fpmod.FPmod.progress_pregnancy(uids)Advance pregnancy in time and check for miscarriage
reset_postpartum
fpmod.FPmod.reset_postpartum(uids)Stop breastfeeding and reset durations
step
fpmod.FPmod.step()Perform all updates to people within a single timestep
update_breastfeeding
fpmod.FPmod.update_breastfeeding()Update breastfeeding status, resetting to False for anyone finished
update_mortality
fpmod.FPmod.update_mortality()Update infant and maternal mortality for the sim’s current year. Update general mortality trend as this uses a spline interpolation instead of an array.
update_postpartum
fpmod.FPmod.update_postpartum()Update postpartum status, resetting to False for anyone finished
update_time_to_choose
fpmod.FPmod.update_time_to_choose(uids=None)Initialise the counter to determine when girls/women will have to first choose a method.