Open mghosh00 opened 7 months ago
core
Person.__init__
(infection_start_time
, secondary_infections
)Person.increment_secondary_infections
new tests
output
AgeStratifiedNewCasesWriter.write
NewCasesWriter.write
tests
property
PersonalFOI.person_susc
tests
routine
Simulation.configure
(add boolean to inf_history_params
)Simulation.run_sweeps
Simulation.write_to_rt_file
newtests
sweep
PlaceSweep.__call__
HouseholdSweep.__call__
SpatialSweep.__call__
HostProgressionSweep.set_infectiousness
HostProgressionSweep._updates_infectiousness
tests
Here is a template for what the output dataframe will look like (maybe not including R_t but is there to illustrate):
time | person A | person B | person C | person D | ... | person Z | R_t |
---|---|---|---|---|---|---|---|
0.0 | nan | nan | 5 | nan | ... | 0 | 2.5 |
1.0 | 3 | nan | nan | nan | ... | nan | 3.0 |
2.0 | nan | nan | nan | nan | ... | nan | 0.0 |
3.0 | nan | nan | nan | 3 | ... | nan | 3.0 |
4.0 | nan | 6 | nan | nan | ... | 2 | 4.0 |
In this scenario, here are the lists of days in which each person becomes infected: A: 1.0 - goes on to infect 3 others B: 4.0 - goes on to infect 6 others C: 0.0 - goes on to infect 5 others D: 3.0 - goes on to infect 3 others E: 0.0 - goes on to infect 0 others, reinfected at 4.0 goes on to infect 2 others
We wish to also take into account the serial interval. For every infection event, the time between the infector's infection_time
and the infectee's infection_time
will be recorded, and back-tracked to the timestep for which the infector was infected. Then we record a histogram of the these times for each timestep.
Example: | time | person A | person B | person C | person D | person E | person F |
---|---|---|---|---|---|---|---|
0.0 | gets infected | ||||||
1.0 | infects B, C | gets infected by A | gets infected by A | ||||
2.0 | infects D | gets infected by B | |||||
3.0 | infects E | infects F | gets infected by A | gets infected by C |
In this scenario, the serial interval vectors look like:
0.0: [1, 1, 3]
- A infects B (1), C (1) and E (3)
1.0: [1, 2]
- B infects D (1), C infects F (2)
2.0: []
- D infects no-one
3.0: []
- E and F infect no-one
core
Person.__init__
(serial_intervals
)Person.set_exposure_period
new Person.store_serial_interval
new tests
routine
Simulation.configure
(add boolean to inf_history_params
)Simulation.run_sweeps
Simulation.write_to_serial_file
newtests
sweep
PlaceSweep.__call__
HouseholdSweep.__call__
SpatialSweep.__call__
HostProgressionSweep.update_time_status_change
tests
Is your feature request related to a problem? Please describe. We wish to record the number of people each person infects over the course of the epidemic (each time they are re-infected) so that we can find the R_t value at each time step. The dataframes produced will be further used in the sampling package EpiOS.
Describe the solution you'd like I will change the
Person
class to record a list of secondary infections each person has during the epidemic. I will also update the simulation to record and output a dataframe containing this information.