metawards.Population

class metawards.Population(initial: int = 0, susceptibles: int = 0, latent: int = 0, total: int = 0, totals: Dict[str, int] = None, recovereds: int = 0, n_inf_wards: int = 0, scale_uv: float = 1.0, day: int = 0, date: datetime.date = None)[source]

This class holds information about the progress of the disease through the population

__init__(initial: int = 0, susceptibles: int = 0, latent: int = 0, total: int = 0, totals: Dict[str, int] = None, recovereds: int = 0, n_inf_wards: int = 0, scale_uv: float = 1.0, day: int = 0, date: datetime.date = None) → None

Methods

__init__(initial, susceptibles, latent, …)
assert_sane() Assert that this population is sane, i.e.
has_equal_SEIR(other) Return whether or not the SEIR values for this population equal ‘other’
headers() Return a list of the headers that should be used to report data from this population.
increment_day(ndays) Advance the day count by ‘ndays’ (default 1)
specialise(network) Specialise this population for the passed Networks
summary([demographics]) Return a short summary string that is suitable to be printed out during a model run

Attributes

date The date in the outbreak of this record
day The day in the outbreak of this record (e.g.
infecteds The number who are infected across all wards
initial The initial population loaded into the model
latent The number of latent infections
n_inf_wards The number infected in all wards
population The total population in all wards
recovereds The total number who are removed from the outbreak, either because they have recovered, or are otherwise no longer able to be infected
scale_uv The scale_uv parameter that can be used to affect the foi calculation.
subpops The populations in each of the multi-demographic subnetworks
susceptibles The number of members who could be infected
total The total number of infections
totals The totao number of infections in other states
__str__()[source]

Return str(self).

assert_sane()[source]

Assert that this population is sane, i.e. the totals within this population and with the sub-populations all add up to the correct values

date = None

The date in the outbreak of this record

day = 0

The day in the outbreak of this record (e.g. day 0, day 10 etc.)

has_equal_SEIR(other)[source]

Return whether or not the SEIR values for this population equal ‘other’

headers()[source]

Return a list of the headers that should be used to report data from this population. This returns a list of headers, e.g. [“S”, “E”, “I”, “R”]

increment_day(ndays: int = 1) → None[source]

Advance the day count by ‘ndays’ (default 1)

infecteds

The number who are infected across all wards

initial = 0

The initial population loaded into the model

latent = 0

The number of latent infections

n_inf_wards = 0

The number infected in all wards

population

The total population in all wards

recovereds = 0

The total number who are removed from the outbreak, either because they have recovered, or are otherwise no longer able to be infected

scale_uv = 1.0

The scale_uv parameter that can be used to affect the foi calculation. A value of 1.0 means do nothing

specialise(network)[source]

Specialise this population for the passed Networks

subpops = None

The populations in each of the multi-demographic subnetworks

summary(demographics=None)[source]

Return a short summary string that is suitable to be printed out during a model run

Returns:summary – The short summary string
Return type:str
susceptibles = 0

The number of members who could be infected

total = 0

The total number of infections

totals = None

The totao number of infections in other states