metawards.Population
- class metawards.Population(initial: int = 0, susceptibles: int = 0, latent: int = 0, total: int = 0, totals: Optional[Dict[str, int]] = None, other_totals: Optional[Dict[str, int]] = None, recovereds: int = 0, n_inf_wards: int = 0, scale_uv: float = 1.0, day: int = 0, date: Optional[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: Optional[Dict[str, int]] = None, other_totals: Optional[Dict[str, int]] = None, recovereds: int = 0, n_inf_wards: int = 0, scale_uv: float = 1.0, day: int = 0, date: Optional[datetime.date] = None) None
Methods
__delattr__
(name, /)Implement delattr(self, name).
__dir__
()Default dir() implementation.
__eq__
(other)Return self==value.
__format__
(format_spec, /)Default object formatter.
__ge__
(value, /)Return self>=value.
__getattribute__
(name, /)Return getattr(self, name).
__gt__
(value, /)Return self>value.
__init__
([initial, susceptibles, latent, ...])__init_subclass__
This method is called when a class is subclassed.
__le__
(value, /)Return self<=value.
__lt__
(value, /)Return self<value.
__ne__
(value, /)Return self!=value.
__new__
(**kwargs)__reduce__
()Helper for pickle.
__reduce_ex__
(protocol, /)Helper for pickle.
__repr__
()Return repr(self).
__setattr__
(name, value, /)Implement setattr(self, name, value).
__sizeof__
()Size of object in memory, in bytes.
__str__
()Return str(self).
__subclasshook__
Abstract classes can override this to customize issubclass().
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.
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
__annotations__
__dataclass_fields__
__dataclass_params__
__dict__
__doc__
__module__
__weakref__
list of weak references to the object (if defined)
The date in the outbreak of this record
The day in the outbreak of this record (e.g.
The number who are infected across all wards
The initial population loaded into the model
The number of latent infections (E)
The number infected in all wards (IW)
The total number of individuals in other non-infected states (X)
Return the number who are in the 'other' state, i.e. not classed as susceptible, latent, infected or recovered/removed.
The total population in all wards
The total number who are removed from the outbreak, either because they have recovered, or are otherwise no longer able to be infected (R)
The scale_uv parameter that can be used to affect the foi calculation.
The populations in each of the multi-demographic subnetworks
The number of members who could be infected (S)
The total number of infections (I)
The total number of infections in other infected states (X)
- __eq__(other)
Return self==value.
- __hash__ = None
- __init__(initial: int = 0, susceptibles: int = 0, latent: int = 0, total: int = 0, totals: Optional[Dict[str, int]] = None, other_totals: Optional[Dict[str, int]] = None, recovereds: int = 0, n_inf_wards: int = 0, scale_uv: float = 1.0, day: int = 0, date: Optional[datetime.date] = None) None
- __repr__()
Return repr(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: datetime.date = None
The date in the outbreak of this record
- day: int = 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”]
- property infecteds: int
The number who are infected across all wards
- initial: int = 0
The initial population loaded into the model
- latent: int = 0
The number of latent infections (E)
- n_inf_wards: int = 0
The number infected in all wards (IW)
- other_totals: Dict[str, int] = None
The total number of individuals in other non-infected states (X)
- property others: int
Return the number who are in the ‘other’ state, i.e. not classed as susceptible, latent, infected or recovered/removed. This is the sum of states that are set as “is_infected=False” in the disease model, e.g. V (vaccinated)
- property population: int
The total population in all wards
- recovereds: int = 0
The total number who are removed from the outbreak, either because they have recovered, or are otherwise no longer able to be infected (R)
- scale_uv: float = 1.0
The scale_uv parameter that can be used to affect the foi calculation. A value of 1.0 means do nothing
- 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: int = 0
The number of members who could be infected (S)
- total: int = 0
The total number of infections (I)
- totals: Dict[str, int] = None
The total number of infections in other infected states (X)