_infections
Operations for zeroing or modifying infections in humans and vectors.
zero_human_infections(humans, *, keep_ids=None)
Reset infection state of individuals to uninfected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
humans
|
Any
|
Iterable of individual dicts (e.g., |
required |
keep_ids
|
list[int]
|
SUID IDs of individuals to skip. |
None
|
Returns:
| Type | Description |
|---|---|
int
|
Number of individuals whose infections were zeroed. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If an individual is missing expected infection fields. |
Source code in emodpy_malaria/serialization/_infections.py
zero_infections(ser_pop, *, ignore_node_ids=None, keep_individual_ids=None, remove_vectors=False)
Zero all infections in the loaded population (in-place).
Resets human infection fields to uninfected state and either resets or removes infected vectors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ser_pop
|
SerializedPopulation
|
A loaded SerializedPopulation. |
required |
ignore_node_ids
|
list[int]
|
Node external IDs to skip entirely. |
None
|
keep_individual_ids
|
list[int]
|
Individual SUID IDs whose infections are preserved. |
None
|
remove_vectors
|
bool
|
If True, remove infected/infectious vector cohorts. If False (default), reset their state to STATE_ADULT. |
False
|
Source code in emodpy_malaria/serialization/_infections.py
zero_vector_infections(vector_pop_list, *, remove=False)
Reset or remove infections from vector populations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector_pop_list
|
Any
|
List of vector populations
( |
required |
remove
|
bool
|
If True, remove infected/infectious cohorts entirely. If False (default), reset to STATE_ADULT. |
False
|
Returns:
| Type | Description |
|---|---|
int
|
Number of vector cohorts affected. |