Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vectorise .add_hospitalisation() #150

Merged
merged 2 commits into from
Jul 1, 2024
Merged

Vectorise .add_hospitalisation() #150

merged 2 commits into from
Jul 1, 2024

Conversation

joshwlambert
Copy link
Member

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.

@joshwlambert joshwlambert added the enhancement New feature or request label Jul 1, 2024
@joshwlambert joshwlambert merged commit 840b272 into main Jul 1, 2024
7 checks passed
@joshwlambert joshwlambert deleted the vec-hosp branch July 1, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant