simulist v0.2.0

new-release
Author

The Epiverse-TRACE development team

Published

February 23, 2024

We are very excited to announce the release of a new simulist version v0.2.0. Here is an automatically generated summary of the changes in this version.

Second release of simulist, updates the core simulation model and, as a result, the arguments for sim_*() functions for simulating line list data and/or contact table data exported from simulist are updated. The internal package architecture is also refactored.

New features

External

  • create_config() now returns a new element in the list: $network. By default create_config() returns network = "adjusted", which assumes the simulation is a random network and samples contacts with an excess degree distribution (see Details in ?create_config()). The network effect can be changed to "unadjusted" to switch off the network effect. $network is checked internally (in .sim_network_bp()) and will error if not valid (#60).
  • Package architecture diagram is added to design-principles.Rmd (#66).
  • lintr GitHub action workflow (lint-changed-files.yaml) is added to the suite of continuous integration workflows (#68).
  • Transmission chain visualisation is added to vis-linelist.Rmd (#70).

Internal

  • .sim_network_bp() is added as an internal function and replaces bpmodels::chain_sim() as the core simulation model producing contacted and infected individuals. {bpmodels} is removed as a dependency as a result (#60).
  • .sample_names() is added as an internal function to utilise randomNames::randomNames() to produce more unique names than randomNames(..., sample.with.replacement = FALSE).
  • Refactor of internal simulation architecture replaced .sim_bp_linelist(), .sim_clinical_linelist() and .sim_contacts_tbl() with .sim_internal() (#66).
  • The sim_utils.R file was renamed to utils.R (#66) and the empty create_linelist.R file was removed (#72).
  • .add_date_contact() argument outbreak_start_date is now NULL by default instead of missing (#82).
  • Regression tests of sim_*() functions now use snapshot testing for more detailed data checking (#65).
  • Internal testing data (testdata) files have been updated, as has the testdata/README.md with instructions (#64).

Breaking changes

  • R and serial_interval arguments have been removed from sim_linelist(), sim_contacts() and sim_outbreak() functions and instead contact_distribution, contact_interval and prob_infect are used to parameterise the simulation. Documentation, both functions and vignettes, have been updated with these changes (#60).
  • The contact_distribution argument in sim_*() functions requires a density function if supplied as an anonymous function. Information is added to simulist.Rmd to explain this.
  • The line list output from sim_linelist() now uses column header sex instead of gender. The contacts table output from sim_contacts() and sim_outbreak() now uses column headers age and sex instead of cnt_age and cnt_gender (#60, #79).
  • contact_distribution is redefined and redocumented as the distribution of contacts per individual, rather than the number of contacts that do not get infected as it was in v0.1.0.
  • row.names for <data.frame>s output by sim_linelist(), sim_contacts() and sim_outbreak() are now sequential from 1:nrows (#63).

Bug fixes

  • sim_contacts() now correctly runs with an age-structured population. In the previous version (v0.1.0), sim_contacts() did not call .check_age_df() and as a result the function errored, this is fixed as of PR #81.

Deprecated and defunct

  • None

Acknowledgements

Many thanks to the contributors to this release, either from issues, code contributions, reviews or discussions (listed in alphabetical order):

@adamkucharski, @avallecam, @Bisaloo, @chartgerink, @jamesmbaazam, @pratikunterwegs, and @sbfnk.

Reuse

Citation

BibTeX citation:
@online{epiverse-trace_development_team2024,
  author = {Epiverse-TRACE development team, The},
  title = {Simulist V0.2.0},
  date = {2024-02-23},
  url = {https://epiverse-trace.github.io/posts/simulist_v0.2.0/},
  langid = {en}
}
For attribution, please cite this work as:
Epiverse-TRACE development team, The. 2024. “Simulist V0.2.0.” February 23, 2024. https://epiverse-trace.github.io/posts/simulist_v0.2.0/.