-
Notifications
You must be signed in to change notification settings - Fork 63
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
Closes #2427 general issue adopt data and data raw conventions #2494
Closes #2427 general issue adopt data and data raw conventions #2494
Conversation
This is a DRAFTGOAL:create data/*.rda files following QUESTION:Is this draft PR an acceptable approach? What I did:Create: example_qs.rda in TWO WAYS:
Pls. lookover new code: data-raw/example_qs_new.R And tested in data-raw/test.R ; this checks that created *.rda files are IDENTICAL Thx. |
HI @jimrothstein is this ready for review? I see some comments but also see it's still marked draft. |
review = NO To address this issue #2494 (data conventions), I am proposing using a code similar to this draft. Goal: Create data/example_qs.rda Replace current code: inst/example_scripts/example_qs.R For future, how should I communicate or label these kinds of pre-PR questions about proposed code/proposed approach? Thx |
@jimrothstein sorry I had misunderstood. The second way (using data_raw) looks good to me. @pharmaverse/admiral any other thoughts before Jim prepares a PR? |
@manciniedoardo DRAFT GOALReplace: inst/example_scripts/example_qs.R To create: data/example_qs.rda Note: Once this PR is successful:
Still to do for THIS PRExcept for a few comments (to be removed or modified), this will become a PR to create *data/example_qs.rda" Not sure:
|
HI @jimrothstein this looks good so far and creating a draft and asking for feedback seems appropriate to me. I would just make sure that the example data where it is used doesn't change anything. I'm not super familiar with where this is being used. Also - looking over at the inst folder - I see some other data creation stuff, e.g. adlb_grading. I am wondering if that should be moved over as well. Anyone (@pharmaverse/admiral ) know what this script is for? https://github.com/pharmaverse/admiral/blob/main/inst/example_scripts/derive_single_dose.R |
It creates the |
Plan (Updated 22 AUG 2024) To verify that created data files (*.rda) are IDENTICAL to those before any changes.
AFTER:
To effect this, propose these intermediate steps:
As a final step
As initial run through:
How to document this? |
Hey Jim - You can play fast and loose with this. The actions we have set up will crash out with all our tests and examples if things are not set up correctly with the example data. Everything is backed up as well - so if something goes awry we can also revert. Thanks for taking this on!! |
@bms63 Ready for 1st serious review. Note:
|
looking good
I think we could benefit from describing the variables, but lets do this in a separate issue and just focus on adopting the data/data-raw convention. Do you mind making one?
noted
can you fix all the failing actions: code style, linting, etc. Thanks again!! |
Since the test.R file is just for testing purposes. Can you just comment out the source parts until we can remove this file? Honestly, it feels like things are pretty good and we can just drop testing for if the two are identical. I'm not really worried about it. |
…no more testing. The file data/example_qs.rda will be used, going forward.
Ah dang looks like we need to roxygenize these files |
Which files?? In
Something like? new issue: |
@jimrothstein I haven't looked too closely. But whatever is causing this needs to get fixed. thought it was telling us to use roxygen stuff. |
style_pkg() - no errors, does check example_qs.R lint() reports no errors.
lint and styler pass now. 👍 fda URL has me stumped - rest my eyes and take another look, must be something obvious.
|
(will re-lint and re-style, but hope otherwise getting closer to goal) |
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.
Can you run styler on your code please
Styler will fix a lot of these linting issues so then we can discuss the more problematic ones |
Alright! We are almost there!! Yay! |
Ran devtools::lint() To be changed to standard form: CACHE_DIR, DATA_RAW ... once I am sure code is correct. NO change to .RBuildignore (not sure if consensus)
adsl.rmd vignette codeknitr::purl("adsl.Rmd", output = "output_file.R")
|
I say we I feel like the admiral adsl was not run with the latest template/vignette scripts updates to them (they look pretty similar). Let's just go with the current script you have put together for @pharmaverse/admiral - I think this is getting very close. Any final thoughts. |
…o nolint a block of code: # nolint start and # nolint end can be used; (done in this commit) Also note, possible to turn off SPECIFIC linters (also done in this commit for "object_name_linter")
Note: This commit uses a few features of
|
…o nolint a block of code: # nolint start and # nolint end can be used; (done in this commit) Also note, possible to turn off SPECIFIC linters (also done in this commit for "object_name_linter")
…it reset back before I accidentally pt it into a push?)
purl_adsl_vignette.R
Outdated
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.
We do not need this
I'm ready to merge this into |
Sorry for the late reply. I was off because the 3rd October is a bank holiday here. I think the PR shouldn't have been merged. There are a lot of unresolved issues:
@bms63 , how should we move on? |
I think another PR will do the trick:
|
I get (when running them manually):
|
should it be |
Yes |
Thank you for your Pull Request! We have developed this task checklist from the Development Process Guide to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the admiral codebase remains robust and consistent.
Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the
main
branch until you have checked off each task.styler::style_file()
to style R and Rmd filesinst/cheatsheet/admiral_cheatsheet.pptx
and re-upload a PDF and a PNG version of it to the same folder. (The PNG version can be created by taking a screenshot of the PDF version.)devtools::document()
so all.Rd
files in theman
folder and theNAMESPACE
file in the project root are updated appropriatelyNEWS.md
under the header# admiral (development version)
if the changes pertain to a user-facing function (i.e. it has an@export
tag) or documentation aimed at users (rather than developers). A Developer Notes section is available inNEWS.md
for tracking developer-facing issues.pkgdown::build_site()
and check that all affected examples are displayed correctly and that all new functions occur on the "Reference" page.lintr::lint_package()
R CMD check
locally and address all errors and warnings -devtools::check()