This PR addresses #125 by vectorising the internal function .add_hospitalisation(). It follows the same vectorisation and interval finding approach as .add_outcome() implemented in #101.
The previous version .add_hospitalisation() looped over a sample(), whereas the new changes made in this PR use a vectorised rbinom() call so there will likely be a different number of random samples in the simulation between versions. This is the reason that the sim_linelist() and sim_outbreak() snapshots for unit tests needed updating. Only the columns of the linelist that are randomly generated after .add_hospitaliation() have changed.
This PR addresses #125 by vectorising the internal function
.add_hospitalisation()
. It follows the same vectorisation and interval finding approach as.add_outcome()
implemented in #101.The previous version
.add_hospitalisation()
looped over asample()
, whereas the new changes made in this PR use a vectorisedrbinom()
call so there will likely be a different number of random samples in the simulation between versions. This is the reason that thesim_linelist()
andsim_outbreak()
snapshots for unit tests needed updating. Only the columns of thelinelist
that are randomly generated after.add_hospitaliation()
have changed.