-
Notifications
You must be signed in to change notification settings - Fork 16
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
Modify get available datasets #382
Conversation
👋 Thanks for opening this pull request! Can you please run through the following checklist before requesting review (ticking as complete or if not relevant).
Thank you again for the contribution. If making large scale changes consider using our |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice idea. Maybe could do both of this in one function with an arg?
…sets with options for rendering. also added parameter for namespace and updated tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just the bells and whistles to bring into line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. This feels quite elegant.
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