stisim.interventions.base_interventions module#

Define interventions for STIsim

class stisim.interventions.base_interventions.STIDx(df, disease, *args, **kwargs)[source]#

Bases: Product

Generic class for diagnostics with a positive/negative outcome Uses bernoulli sampling, so can only be used for tests with binary outcomes Results vary depending on agents’ true underlying health state

p_positive()[source]#
administer(sim, uids)[source]#

Administer a testing product.

class stisim.interventions.base_interventions.STITest(pars=None, test_prob_data=None, years=None, start=None, stop=None, eligibility=None, product=None, name=None, label=None, **kwargs)[source]#

Bases: Intervention

Base class for STI testing

property states#

Return a flat list of all states

The base class returns all states that are contained in top-level attributes of the Module. If a Module stores states in a non-standard location (e.g., within a list of states, or otherwise in some other nested structure - perhaps due to supporting features like multiple genotypes) then the Module should overload this attribute to ensure that all states appear in here.

init_pre(sim)[source]#

Perform initialization steps

This method is called once, as part of initializing a Sim. Note: after initialization, initialized=False until init_vals() is called (which is after distributions are initialized).

init_results()[source]#

Initialize any results required; part of init_pre()

static make_test_prob_fn(self, sim, uids)[source]#

Testing probabilites over time

get_testers(sim)[source]#

Find who tests by applying eligibility and coverage/uptake

schedule(uids, ti)[source]#
step(uids=None)[source]#

Apply the testing intervention

update_results()[source]#

Perform any results updates on each timestep

class stisim.interventions.base_interventions.SymptomaticTesting(pars=None, treatments=None, diseases=None, disease_treatment_map=None, treat_prob_data=None, years=None, start=None, stop=None, eligibility=None, name=None, label=None, **kwargs)[source]#

Bases: STITest

Base class for symptomatic testing with multiple possible etiologies Unlike other test classes, this doesn’t return positive/negative outcomes, since syndromic management doesn’t involve reaching a diagnosis. Rather, the testing intervention itself contains a linked treatment intervention.

init_pre(sim)[source]#

Perform initialization steps

This method is called once, as part of initializing a Sim. Note: after initialization, initialized=False until init_vals() is called (which is after distributions are initialized).

init_results()[source]#

Initialize any results required; part of init_pre()

step(uids=None)[source]#

Apply syndromic management

update_results()[source]#

Perform any results updates on each timestep

class stisim.interventions.base_interventions.STITreatment(name=None, pars=None, diseases=None, eligibility=None, max_capacity=None, years=None, *args, **kwargs)[source]#

Bases: Intervention

Base class for treatment of STI infection. The majority of STI treatments will clear infection.

Args:

pars: disease (str): should match the name of one of the diseases in the simulation

init_results()[source]#

Initialize any results required; part of init_pre()

get_candidates(sim)[source]#

Get people who are willing to accept treatment

set_treat_eff(uids)[source]#

Can be changed by derived classes

administer(sim, uids, disease, return_format='dict')[source]#

Administer treatment, keeping track of unnecessarily treated individuals

change_states(disease, treat_succ)[source]#

Change the states of people who are treated

step()[source]#

Apply treatment. On each timestep, this method will add eligible people who are willing to accept treatment to a queue, and then will treat as many people in the queue as there is capacity for.

update_results()[source]#

Perform any results updates on each timestep

class stisim.interventions.base_interventions.PartnerNotification(disease, eligible, test, test_prob=0.5, **kwargs)[source]#

Bases: Intervention

identify_contacts(sim, uids)[source]#
notify(sim, uids)[source]#
step()[source]#

Define how the module updates over time – the key part of Starsim!!

class stisim.interventions.base_interventions.ProductMix(df, excl_cols=None, *args, **kwargs)[source]#

Bases: Product

Generic class for algorithms that determine which product a person will receive Uses ss.choice() sampling, which is slower than bernoulli, when there are more than two options The test that agents are given does NOT depend on their underlying health state.

init_pre(sim)[source]#

Perform initialization steps

This method is called once, as part of initializing a Sim. Note: after initialization, initialized=False until init_vals() is called (which is after distributions are initialized).

administer(sim, uids)[source]#

Apply a testing algorithm