-
Notifications
You must be signed in to change notification settings - Fork 64
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 #2526 data raw data round 2 #2527
base: main
Are you sure you want to change the base?
Closes #2526 data raw data round 2 #2527
Conversation
Thanks @jimrothstein - did the scripts get re-run? I am wondering if there is some way to could apply a timestamp in the attributes of the datasets that could help us keep track of when this dataset was last created?? This way at least GitHub would detect the change in the timestamp as I am hoping the data doesn't change in the future - or if it does we know why!?! @bundfussr WDYT? |
@bms63 , what do you want to achieve? If we add an attribute with a timestamp, git considers the file as changed even if the dataset was just recreated without any change (except the timestamp attribute). Therefore I'm not sure if this is a good idea. I think we should rerun the |
god-like powers. :) I want some way to track when the datasets were last run. if i see the datasets timestamp was run a couple of days before release then I will be happy. if i see the datasest timestamp was run two months before the release then I will be sad and know I need to run them. maybe we should just run them with a custom script with GHA with each PR???? maybe this is where diffdf could be used to give us a report of any changes occurring in vignettes where these datasets are being used? simplest solution is just to add a checkbox in my release checklist :) #2394 (comment) |
Will add something like:
Just fyi, I saw this older thread about |
I realized I can see the timestamp in GitHub so the attributes update might be overkill @bundfussr |
Ran package check. Admiral templates use tools:R_user_dir() to store generated files; update scripts here to use same function.
@bms63 , I wouldn't add an extra GHA for checking because the templates and pharmaversesdtm change rarely. Adding a checkbox to the release checklist seems the better option to me. |
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.
The comparison shouldn't be removed and the code should be simplified:
# Create dataset data/admiral_adlb.rda
# Run template script to create adlb
source("inst/templates/ad_adlb.R", echo = TRUE) # nolint
# Limit rows by selecting only these USUBJIDs
usubjids <-
c(
"01-701-1015",
"01-701-1023",
"01-701-1028",
"01-701-1033",
"01-701-1034",
"01-701-1047",
"01-701-1097",
"01-705-1186",
"01-705-1292",
"01-705-1310",
"01-708-1286"
)
admiral_adlb <- filter(adlb, USUBJID %in% usubjids)
# Get previous dataset for comparison
adlb_old <- admiral::admiral_adlb
# Finally, save reduced dataset
usethis::use_data(admiral_adlb, overwrite = TRUE)
# Compare with previous version
diffdf::diffdf(
base = adlb_old,
compare = admiral_adlb,
keys = c("USUBJID", "PARAMCD", "AVISIT", "ADT")
)
data-raw/create_admiral_adsl.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.
Please update similar as suggested for create_admiral_adlb.R
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.
@bundfussr
Changes made. Code is better! (Probably used inner join
because saw this elsewhere)
One question: adlb_old <- admiral::admiral_adlb
As soon as I run code locally then load_all(), old
is what I just ran (not original old
)
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.
One question: adlb_old <- admiral::admiral_adlb
As soon as I run code locally then load_all(),old
is what I just ran (not originalold
)
Yes, that's correct. Is that an issue?
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.
No, should not be issue ....
also my latest push has link error in Readme
[<img src="http://pharmaverse.org/shields/admiral.svg">](https://pharmaverse.org)
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.
thats okay - it goes bad from time to time.
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.
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.
maybe the culprit - no need to worry about this @jimrothstein we will get it sorted
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.
Add that link to the ignored ones for now and we'll get the pharmaverse site fixed eventually for this, as per the issue Ben shared. We've been facing some back-end issues with the site and this bug came as a result but should be fixed this month.
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.
The link check is not required, i.e., we can merge even if it fails. I would not add the link to the ignore file because then we need to remember to remove it later.
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.
Up to you really. I was just thinking in case the fix takes longer and lots of PRs see the same. Plus that link has no real impact on the package anyway.
…uestion: is diffdf correctly comparing old & new datasets? (load_all() re-reads datasets)
data-raw/create_admiral_adlb.R
Outdated
@@ -7,7 +7,7 @@ library(diffdf) # nolint | |||
|
|||
# To clarify directories (can be removed) |
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.
Code from line 5 to 19 should be removed (also in create_admiral_adsl.R
).
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()