hpvsim.hiv module

Defines classes and methods for HIV natural history

class HIVsim(sim, art_datafile, hiv_datafile, hiv_pars)[source]

Bases: ParsObj

A class based around performing operations on a self.pars dict.

Initialization

update_pars(old_pars=None, new_pars=None, create=True)[source]
static init_states(people)[source]

Add HIV-related states to the people states

init_results(sim)[source]
set_hiv_prognoses(people, inds, year=None, incident=True)[source]

Set HIV outcomes

check_hiv_death(people)[source]

Check for new deaths from HIV

update_cd4(people)[source]

Update CD4 counts

step(people=None, year=None)[source]

Wrapper method that checks for new HIV infections, updates prognoses, etc.

new_hiv_infections(people, year=None)[source]

Apply HIV infection rates to population

update_hpv_progs(people)[source]

Update people’s relative susceptibility, severity, and immunity

update_hiv_results(people, hiv_inds)[source]

Update the HIV results

get_hiv_data(hiv_datafile=None, art_datafile=None)[source]

Load HIV incidence and art coverage data, if provided

Parameters:
  • location (str) – must be provided if you want to run with HIV dynamics

  • hiv_datafile (str) – must be provided if you want to run with HIV dynamics

  • art_datafile (str) – must be provided if you want to run with HIV dynamics

  • verbose (bool) – whether to print progress

Returns:

dictionary keyed by sex, storing arrays of HIV incidence over time by age art_cov (dict): dictionary keyed by sex, storing arrays of ART coverage over time by age

Return type:

hiv_inc (dict)

load_data(hiv_datafile=None, art_datafile=None)[source]

Load any data files that are used to create additional parameters, if provided

finalize(sim)[source]

Compute prevalence, incidence.