Closed joseph-palmer closed 3 years ago
👋 Thanks for opening this pull request! Can you please run through the following checklist before requesting review (ticking as complete or if not relevant).
devtools::load_all(); devtools::test()
) first setting options(testDownload=TRUE, testSource=class-name)
and report your findings. devtools::load_all(); devtools::test()
). Thank you again for the contribution. If making large scale changes consider using our pre-commit
hooks (see the contributing guide) to more easily comply with our guidelines.
ah did we include this in the news and increment the dev version?
Ah no I forgot, sorry!
No problem we can slip it in as a news update prior to release.
Rather than initialising every class when calling
get_available_datasets
this PR moves the data produced byget_available_datasets
to package data (contained indata/
) calledall_country_data
(happy to change this name). Now callingget_available_datasets()
returns the saved data (and also filters for type using the type argument). The previous version ofget_available_data()
is now in a new function calledrender_available_data()
which, when called will create the table by initalising each class like the previous version did.A new R file called
render_available_datasets.R
indata-raw/
writes theall_country_data
to the package data (which is also defined indatasets.R
). To ensure contributors run this after adding a new dataset class I have added a test which will compare the current available datasets with that outputed by runningrender_available_datasets()
. This will fail if a dataset class is added or if something in the class which is used in the table is modified (such as number of levels or urls) but theall_country_data
table has not be re-rendered by running therender_available_datasets.R
script. If this fails it will highlight this and suggest to runrender_available_datasets.R
.closes #372