diseases.sti

diseases.sti

Template class for SEIS-type STIs Used for chlamydia, gonorrhea, and trich

Classes

Name Description
BaseSTI Base class for sexually transmitted infections.
BaseSTIPars Base parameters shared by all STI disease modules.
SEIS SEIS (Susceptible-Exposed-Infectious-Susceptible) disease template.
STIPars Parameters for SEIS-type STI models.

BaseSTI

diseases.sti.BaseSTI(name=None, pars=None, init_prev_data=None, **kwargs)

Base class for sexually transmitted infections.

Extends ss.Infection with STI-specific transmission logic, including network-specific beta values, condom efficacy, and initial prevalence by sex and risk group. All STIsim disease modules inherit from this class.

Parameters

Name Type Description Default
name str Module name used for results and parameter routing. None
pars dict Override default parameters from BaseSTIPars. None
init_prev_data Initial prevalence data (float or DataFrame by age/sex/risk group). None
**kwargs Additional parameters passed to update_pars. {}

Attributes

Name Description
treatable Assume infected people are treatable, can be overwritten in subclasses

Methods

Name Description
agehist Return an age histogram
init_results Initialize results
make_init_prev Initialize prevalence by sex and risk group
set_outcomes Set prognoses for newly infected agents and track transmission routes.
step Override to pass network indices to set_outcomes for MTCT tracking
validate_beta Map disease-specific transmission parameters onto the betamap.
agehist
diseases.sti.BaseSTI.agehist(a)

Return an age histogram

init_results
diseases.sti.BaseSTI.init_results()

Initialize results

make_init_prev
diseases.sti.BaseSTI.make_init_prev(uids=None, data=None, active=True)

Initialize prevalence by sex and risk group

set_outcomes
diseases.sti.BaseSTI.set_outcomes(uids, sources, net_ids=None)

Set prognoses for newly infected agents and track transmission routes.

Parameters
Name Type Description Default
uids UIDs of agents newly infected this timestep (not all agents) required
sources UIDs of the agents who transmitted to each new case required
net_ids array of network indices indicating which network each infection came from (used to distinguish prenatal vs postnatal MTCT). Passed from step() via infect(). None
step
diseases.sti.BaseSTI.step()

Override to pass network indices to set_outcomes for MTCT tracking

validate_beta
diseases.sti.BaseSTI.validate_beta()

Map disease-specific transmission parameters onto the betamap.

The parent class (ss.Infection) builds a betamap keyed by standardized network name, with [beta_p1→p2, beta_p2→p1] per network. Here we override entries for STI-specific networks using disease parameters:

- structuredsexual: beta_m2f (and rel_beta_f2m for female→male)
- maternal: beta_m2c (prenatal MTCT)
- breastfeeding: beta_breastfeed (postnatal MTCT, HIV only)
- msm: beta_m2m (bidirectional)

BaseSTIPars

diseases.sti.BaseSTIPars(**kwargs)

Base parameters shared by all STI disease modules.

Holds transmission parameters (beta values, condom efficacy), timestep settings, and initial prevalence configuration.

SEIS

diseases.sti.SEIS(pars=None, name=None, init_prev_data=None, **kwargs)

SEIS (Susceptible-Exposed-Infectious-Susceptible) disease template.

Provides the standard natural history framework for bacterial STIs: latent exposure period, sex-stratified symptom onset, symptomatic care-seeking, PID complications in females, and natural clearance. Used as the base class for chlamydia, gonorrhea, and trichomoniasis.

Parameters

Name Type Description Default
pars dict Override default parameters from STIPars. None
name str Module name used for results and parameter routing. None
init_prev_data Optional initial prevalence data by age/sex. None
**kwargs Additional parameters passed to update_pars. {}

Attributes

Name Description
treatable Active bacterial presence – includes exposed and infected, and responds to treatment

Methods

Name Description
init_results Initialize results
set_prognoses Set initial prognoses for adults newly infected
step_state Updates for this timestep
wipe_dates Clear all previous dates
init_results
diseases.sti.SEIS.init_results()

Initialize results

set_prognoses
diseases.sti.SEIS.set_prognoses(uids, sources=None)

Set initial prognoses for adults newly infected

step_state
diseases.sti.SEIS.step_state()

Updates for this timestep

wipe_dates
diseases.sti.SEIS.wipe_dates(uids)

Clear all previous dates

STIPars

diseases.sti.STIPars(**kwargs)

Parameters for SEIS-type STI models.

Extends BaseSTIPars with natural history parameters including symptom probabilities, care-seeking behavior, PID progression, and clearance durations. Used as the default parameter set for chlamydia, gonorrhea, and trichomoniasis.