epiverse-trace / epiparameter

R package with library of epidemiological parameters for infectious diseases and functions and classes for working with parameters
https://epiverse-trace.github.io/epiparameter
Other
33 stars 11 forks source link

Refactor internal parameter cleaning #331

Closed joshwlambert closed 5 months ago

joshwlambert commented 5 months ago

This PR removes the use of S3 dispatch to call internal distribution parameter cleaning functions and moves to using switch(). A bullet point is added to the design_principles.Rmd vignette on using S3 dispatch exclusively for exported functions.

The internal clean_epidist_params() is renamed with a dot prefix (.clean_epidist_params()). A bullet point is added to the design_principles.Rmd vignette on the use of dot prefixes for internal functions.

The .clean_epidist_params_*() distribution specific cleaning functions have been simplified thanks to having stricter parameter matching.

Documentation and unit tests have been updated where needed.