products

products

Define products

Classes

Name Description
Dx Generic class for diagnostics
Product Generic product base class; subclasses implement administer().
Tx Treatment products change fundamental properties about People, including their prognoses and infectiousness.
Vx Vaccine product; subclasses implement administer() to apply immunity.
simple_vx Create a simple vaccine product that affects the probability of infection.

Dx

products.Dx(df=None, hierarchy=None, *args, **kwargs)

Generic class for diagnostics

Methods

Name Description
administer Administer a testing product.
administer
products.Dx.administer(uids, return_format='dict')

Administer a testing product.

Returns:

 if return_format=='array': an array of length len(inds) with integer entries that map each person to one of the result_states
 if return_format=='dict': a dictionary keyed by result_states with values containing the indices of people classified into this state

Product

products.Product(name=None, label=None, **kwargs)

Generic product base class; subclasses implement administer().

Products represent diagnostic tests, treatments, or vaccines that can be administered to agents by an Intervention.

Methods

Name Description
administer Administer a Product - implemented by derived classes
init_pre Initialize the product; skips if already initialized
administer
products.Product.administer(uids)

Administer a Product - implemented by derived classes

init_pre
products.Product.init_pre(sim)

Initialize the product; skips if already initialized

Tx

products.Tx(df=None, *args, **kwargs)

Treatment products change fundamental properties about People, including their prognoses and infectiousness.

Parameters

Name Type Description Default
df DataFrame treatment specification with columns ‘disease’, ‘state’, ‘post_state’, ‘efficacy’ None

Methods

Name Description
administer Loop over treatment states to determine those who are successfully treated and clear infection
administer
products.Tx.administer(uids, return_format='dict')

Loop over treatment states to determine those who are successfully treated and clear infection

Vx

products.Vx(diseases=None, *args, **kwargs)

Vaccine product; subclasses implement administer() to apply immunity.

Methods

Name Description
administer Apply the vaccine to the requested uids.
administer
products.Vx.administer(uids)

Apply the vaccine to the requested uids.

simple_vx

products.simple_vx(**kwargs)

Create a simple vaccine product that affects the probability of infection.

The vaccine can be either “leaky”, in which everyone who receives the vaccine receives the same amount of protection (specified by the efficacy parameter) each time they are exposed to an infection. The alternative (leaky=False) is that the efficacy is the probability that the vaccine “takes”, in which case that person is 100% protected (and the remaining people are 0% protected).

Parameters

Name Type Description Default
efficacy float efficacy of the vaccine (0<=efficacy<=1) required
disease int / str / list the disease to modify (if None, modify all) required
leaky bool see above required