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

Store and read parameter library as sysdata #207

Merged
merged 6 commits into from
Nov 16, 2023
Merged

Store and read parameter library as sysdata #207

merged 6 commits into from
Nov 16, 2023

Conversation

joshwlambert
Copy link
Member

This PR addresses #198 by adding sysdata.rda to the package and reading from sysdata in epidist_db(). To optimise the performance of reading the epidemiological parameters into the R environment, the database is not read and formatted as <epidist> objects each time.

The code that creates the sysdata is added to data-raw/parameters.R.

A test is added for .read_epidist_db() as this code is no longer run when epidist_db() is called (unless the sysdata cannot be located, a situation which cannot be mocked in testing).

The dev-utils is updated to remind updating the sysdata at every release. The .Rbuildignore is updated to include data-raw.

@joshwlambert joshwlambert added data management pkg infrastructure General update tasks relating to the package and not functionality labels Nov 15, 2023
R/epidist_db.R Outdated Show resolved Hide resolved
data-raw/parameters.R Show resolved Hide resolved
@joshwlambert
Copy link
Member Author

@TimTaylor thanks for reviewing! Please approve the PR if you're happy with the changes.

@joshwlambert joshwlambert merged commit 0e9de84 into main Nov 16, 2023
10 checks passed
@joshwlambert joshwlambert deleted the sysdata_db branch November 16, 2023 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data management pkg infrastructure General update tasks relating to the package and not functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants